sql查询语句

--条件查询: select 列名列表 from 表名 where 条件
--where 条件:用来筛选满足条件的记录(行)
--条件有6种形式:
--1.比较大小:列名 比较运算符 值
--查询图书价格超过30元的图书信息
select * from Book where price>30
--查询清华大学出版社出版的图书信息
select * from Book where publish='清华大学出版社'
--查询2005-1-20日借书的图书编号
select * from borrow where borrowdate='2005-1-20'
--2.范围查询,
--查询在1976年出生的读者信息
select * from reader
where birthdate between '1976-1-1' and '1977-1-1'
--3.符合条件用and,or连接各条件
--查询各图书价格不再20-40之间的图书信息
select * from book where price not between 20 and 40
--集合查询: 列名【not】 in (值列表)
--查询图书价格是20,30,40,的图书信息
--查询清华大学,同济大学出版社出版的图书信息
select * from book where price=20 or price=30 or price=40
select * from book where price in (20,30,40)
select * from book where publish='清华大学出版社' or publish='同济大学出版社'
select * from book where publish not in('清华大学出版社','同济大学出版社')
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值