复制代码 代码如下:
select * from (
select *, ROW_NUMBER() OVER(Order by a.CreateTime DESC ) AS RowNumber from table_name as a
) as b
where RowNumber BETWEEN 1 and 5
复制代码 代码如下:
select *
from(
select ROW_NUMBER() OVER( ORDER BY PSIO.CreateTime DESC ) AS RowNumber,PSIO.SeqNo,PSIO.CreateTime from dbo.Output PSIO
inner join Album PPA on PSIO.PPAID=PPA.PPAID
where PPA.PPAID=103--PPAID=3.PPAID
) T where RowNumber BETWEEN 1 and 5 order by 1
新闻热点
疑难解答