DECLARE @a INT SET @a=1while @a<=@nCOUNT begin select top 1 * from (SELECT TOP (@a) * FROM HuoDongGanKaNpc WHERE HuoDongId=@HuoDongId) as a order by a.nRound DESC set @a=@a+1 end
SELECT TOP(@a) * FROM ....