三、基礎查詢——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。