22,209
社区成员
发帖
与我相关
我的任务
分享
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
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 序号