二 :条件查询

语法:select    列表名

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

           from      表名

           where    筛选条件

例如:

select   salary
from     employees
where   salary>1000;

二:筛选条件的分类

1.简单的运算符

 >,<,<=,>=,<>(不等于),<=>(安全等于)

2.逻辑运算符

&& ,and

||   ,or

!    ,not

3.模糊查询

like:一般搭配通配符使用,可以判断字符型或数值型
通配符:%任意多个字符,_任意单个字符

between and
in
is null /is not null:用于判断null值

例如

#查看在员工表中名字之中有e的人
select  last_name
from   employees
where  last_name like '%e%';                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  vv

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄