将每次排序之后的结果插入临时表:select
identity(int,1,1) as id,*
into
#t
from
(select top 100 percent * from VIP order by ...) a
然后从临时表把结果按编号顺序取出来select * from #t order by id
identity(int,1,1) as id,*
into
#t
from
(select top 100 percent * from VIP order by ...) a
然后从临时表把结果按编号顺序取出来select * from #t order by id
select * from #t order by id, userid desc
select * from #
二楼的如何??