sql查询二

  --从people1中取出第n到第m条的数据
select top m-n+1 *
from people1
where (ID not in(select top n-1 id from people1))

--不在前4条的id(id是5+)中的前四条

例如:--从people1中取出第五到第八条的数据
select top 4 *
from people1
where (ID not in(select top 4 id from people1))

 

posted on 2018-01-25 16:57  heihaha  阅读(114)  评论(0编辑  收藏  举报