一,语法
select 查询列表
from 表名
where 筛选条件
二,筛选条件的分类
1,简单条件运算符
> < = != >= <= <=>安全等于 <>不等于
示例:select * from employee where salary>10000
2,逻辑运算符
&& and
|| or
! not
示例:select * from employee where salary>10000 and salary<20000
3,模糊查询
like
示例:select * from employee where name like '%a%';(name中包含a的显示出来)
select * from employee where name like '__a%';(name中第三个字母是a的显示出来
注:%匹配任意个字符,_匹配任意单个字符,可以用 \ 进行转义
between and
示例:select * from employee where salary between 10000 and 20000
in
示例:select * from employee where salary in {10000,11000,12000};
is null(用来判断null值,=不能判断null值,<=>可以判断null值)
is not null