数据库基本操作3——筛选where

一,语法

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值