日期:2014-05-17 浏览次数:20640 次
select top 20 * from biao where not in(select top 10 * from biao)
declare @page_size int;
declare @page_num int;
--比如:每页10条记录
set @page_size = 10;
--比如:先取第1页
set @page_num = 1;
select *
from
(
select *,
(row_number() over(order by @@servername) - 1) / @page_size as pagenum
from from biao
)t
where pagenum = @page_num - 1
;with TT
(
select * ,row_number()over(partition by 分组列 order by getdate()) as num
from TB)
select * from TT where num between 10 and 20 and ...lz的一些条件
with TT as
(select *,
row_number() over(partition by pname order by getdate()) 'num'
from Project)
select *
from TT
where num between 10 and 20