有一个表student,字段是name,score,分别是学生名和学分,我现在要显示学分前30名的学生姓名和学分。
但是要按学分的从第30名那个开始显示,也就是说,第一名的学分的学生显示在最后!我之前是这样写的 select top 30 * from student where score desc,这样只能按学分的从高到低排序。我原本是想从第30名排到第一名的,怎么实现!谢谢!
但是要按学分的从第30名那个开始显示,也就是说,第一名的学分的学生显示在最后!我之前是这样写的 select top 30 * from student where score desc,这样只能按学分的从高到低排序。我原本是想从第30名排到第一名的,怎么实现!谢谢!
from (select top 30 * from student order by score desc ) k
order by score
这样不行吗?
select
*
from
(select top 30 * from student order by score desc )t
order by
score
select * from (select * from tb order by score desc) order by score asc
from (select top 30 * from student order by score desc ) k
order by score DESC