总结:and 用于where 条件中拼接条件 && 用于 if 逻辑判断。
&&的使用(条件表达式中): IF last_accting_date IS NOT NULL && DATE_FORMAT(NOW(), '%Y-%m-%d') = DATE_FORMAT(last_accting_date, '%Y-%m-%d') and的使用(where后面的多条件并且) select * from student where studentName='李四' and sex=1 但在写代码过程中发现,在where中使用&&也是正确的 select * from student where studentName='李四' && sex=1 很是惊讶,不过还是按规范点的来,哈哈 |
|
|