日期:2014-05-18 浏览次数:20572 次
select top 7 * from (select top 18 * from TB) T order by id desc
------解决方案--------------------
select * from
(
select row_number() over (order by getdate()) rownum,*
from table
) as t where t.rownum between 12 and 18
------解决方案--------------------
top 和 order by 是对应的,要取前多少条,一定有排序的标准,如果不写order by 就按照默认的顺序取。
------解决方案--------------------