日期:2014-05-17 浏览次数:20746 次
select 人, 分数 from
(select 人, 分数, row_number() over(order by ID desc) 'rn'
from
(select top 6 人, 分数, ID
from [表名] order by ID desc) t
) y
where rn=1
select 人, 分数 from
(select 人, 分数, row_number() over(order by ID desc) 'rn'
from
(select top 6 人, 分数, ID
from [表名] order by ID desc) t
) y
where rn=2
select 人, 分数 from
(select 人, 分数, row_number() over(order by ID desc) 'rn'
from
(select top 6 人, 分数, ID
from [表名] order by ID desc) t
) y
where rn=3
select 人, 分数 from
(select 人, 分数, row_number() over(order by ID desc) 'rn'
from
(select top 6 人, 分数, ID
from [表名] order by ID desc) t
) y
where rn=4
select 人, 分数 from
(select 人, 分数, row_number() over(order by ID desc) 'rn'
from
(select top 6 人, 分数, ID
from [表名] order by ID desc) t
) y
where rn=5
select 人, 分数 from
(select 人, 分数, row_number() over(order by ID desc) 'rn'
from
(select top 6 人, 分数, ID
from [表名] order by ID desc) t
) y
where rn=6