日期:2014-05-18 浏览次数:20465 次
select *, 序号=(select count(1) from (select top 10 * from tb order by id) b where b.id>=a.id) from (select top 10 * from tb order by id) a order by 序号
------解决方案--------------------
select top 10 id=identity(int,1,1),yourcolums into #t from yourtable select id as 排序序号,yourcolumns from #t order by id desc drop table #t