码迷,mamicode.com
首页 > 数据库 > 详细

sql遍历所有数据集

时间:2015-06-25 15:37:15      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:

DECLARE @a int
set @a = 1
while @a < 5
BEGIN
select top(1) * from QPShuGameMatchDB..MatchScoreStatistics
where UserID in 
(
select top (@a) UserID from QPShuGameMatchDB..MatchScoreStatistics order by Score desc 
)
order by Score;
set @a = @a + 1
END

sql遍历所有数据集

标签:

原文地址:http://blog.csdn.net/liujiayu2/article/details/46636493

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!