(1)like 一般与通配符进行搭配使用
通配符 %任意多个字符,包含0个字符 。 _任意单个字符
#查询员工名中包含字符a的员工信息
select * from 表名 where 列名 like '%a%';
#查询员工名中第三个字符a的员工信息
select * from 表名 where 列名 like '__a%';
escape后指定转义字符
select * from 表名 where 列名 like '_$_%' escape $;
(2)between and 包含临界值
临界值不能颠倒顺序
#查询员工编号为100到200之间的员工信息
select * from 表名 where id>=100 and id<=200;
>= <=
select * from 表名 where id between 100 and 200;
(3) in in 相当于 =
in列表的值类型必须一致或兼容
#查询编号为1和2 的员工信息
select * from 表名 where id in(1,2);
(4)is null / is not null
#查询没有奖金的员工名
select name from 表名 where 奖金 is null;
#查询没有奖金的员工名
select name from 表名 where 奖金 is not null;