一 //查询某表中的第30到40行的数据
select * from 表名 where 字段 in( select top 40 字段 from 表名 )and 字段 not in( select top 30 字段 from 表名)
或者
select top 10 * from 表名 where 字段 not in( select top 30 字段 from 表名)
二 //查询一个表中存在重复的字段“字段1”
select DISTINCT 字段1 from 表名 having count(字段1)>1 group by 字段1
(并显示可能重复的次数)
select DISTINCT 字段1, count(字段1) As 次数 from 表名 having count(字段1)>1 group by 字段1
如不清楚请留言 或登录 http://www.lvtaostudio.com 查看和留言