数据库之 where

where 之比较运算

>  <   >=  =  <=  !=  (select * from students where age  = 18)

where 之逻辑运算

and  or   not   (select *from student where age = 18 and ( or ) gender = "女")

not 用例 (查找学生小于18岁 , 并且性别是女性   select * from students where not age>18 and gender  = "女")

where 之模糊查询

1. like 

2.% : 表示任意多个任意字符

3.  _ :表示一个任意字符    (例如: select *from students where name = "小%"【%小 , %小% , _小 , __小,__%】)

where 之范围查询  (范围查询分为连续范围查询和非连续范围查询)

in : 非连续      select  name  from students where age in (18,34);

between ...  and ...      : select name from students where age between 18 and 34;

where 之空值判断

is null :表示判断值为空    (select * from students where age is null)

is not null :表示判断值非空  (select * from students where age is not  null)

原文地址:https://www.cnblogs.com/liuxjie/p/12166394.html