1.select from where 子句–给定范围
use tesbase
go
--范围查询
--1.select from where 子句--给定范围
--1)比较运算符 > < = >= <=
select *from test where age<25 --年龄小于25的
--2)in ( )在这个范围之内的 not in( )不在这个范围之内的
select * from test where age in(25,26,27) --查询年龄是25,26,27的
select * from test where age not in(25,26,27) --查询年龄不是25,26,27的
--3)between and 等价于>=and<=
select *from test where age between 22 and 27 --查询年龄22到27
2.前面多少条,百分比
--2.前面多少条,百分比
select top 50 percent * from test --查询前百分之五十