日期:2014-05-18 浏览次数:20588 次
select top 5 * from (select top 15 * from INFO where SORT='news') as a order by id desc --就是分页嘛
------解决方案--------------------
select * from (select ROW_NUMBER()over(order by getdate())rn,* from INFO where SORT='news')a where rn between 11 and 15
------解决方案--------------------
--不好意思上边表名写错了 ---不应该从时间上去取值的,应从id取 select * from (select row_number() over(order by id)rn,* from into where sort='news')t where rn between 11 and 15