标签:
top子句
eg:
select * from persons limit 5
select * from persons where rownum<=5
select top 2 * from persons (从"Persons" 表中选取头两条记录)
select top 50 percent * from persons (从"Persons" 表中选取 50% 的记录)
like操作符
eg:
select * from Persons where city not like ‘%lon%‘
通配符
select * from Persons where city like ‘%lond%‘
select * from Persons where firstname like ‘_eorge‘
select * from Persons where lastname like ‘c_r_er‘
select * from persons where city like ‘[ALN]%‘ (从 "Persons" 表中选取居住的城市以 "A" 或 "L" 或 "N" 开头的人)
select * from persons where city like ‘[!ALN]%‘ (从 "Persons" 表中选取居住的城市不以 "A" 或 "L" 或 "N" 开头的人)
IN操作符
IN操作符允许我们在where子句中规定多个值
eg:select * from persons where lastname in(‘adams‘,‘carter‘)
between 操作符
操作符 between ...and会选取介于两个值之间的数据范围,这些值可以是数值、文本、或者日期
select * from persons where lastname between ‘adams‘ and ‘carter‘
select * from persons where lastname not between ‘adams‘ and ‘carter‘
标签:
原文地址:http://my.oschina.net/u/2356966/blog/487265