where子句中的運算符:
<,>,=,!=,>=,<=,in(),between""and"",and,not,or,like
1、其中 <,>,=,!=,>=,<=,in(),between and 屬於比較運算符
in(A,B):表示包含A和B的結果
between 1 and 5 :會查出在1和5之間的值包括1和5
2、and,not,or屬於邏輯運算符
select * from user where age>4 and age <14 : 查詢的出來的結果集中的age處於4和14之間,不包括4和14
select * from user where age>4 or age <3 : 查詢的出來的結果集中的age有大於4的也有小於3的,不包括4和3
select * from user where not age>4 :查詢的出來的結果集中的age沒有大於4,可以等於4
3、、like是模糊查詢
select * from user where phone like '130%' 查詢出user表中phone爲130開頭的用戶
select
* from user where phone like '130_' 查詢出user表中phone爲130開頭後面只有一位的用戶,比如1301
select * from user where phone like '%130%' 查詢出user表中phone中含有130的用戶
select * from user where phone like '%130'查詢出user表中phone爲130結尾的用戶
%爲通配符,不限定位數
_也是通配符,一個表示一位