三、基础查询——MySQL数据库之知识点拾遗(7)
1.空值运算符
(1)常见的空值运算符
is null 和 is not null
(2)实例
示例1:
检查score列的空值并取出该数据。
select * from student_score where score is null;
示例2:
检查score列的非空值并取出该数据。
2.and和or的优先级问题
选择num等于25或者35并且价格大于5的水果的所有信息。
select * from fruit where num=25 or num=35 and price>5;
select * from fruit where (num=25 or num=35) and price>5;
总结:and的优先级高于or。
解锁课程,学习更多mysql知识:
https://study.163.com/course/courseMain.htm?courseId=1209590958&share=2&shareId=400000000537035