34,591
社区成员
发帖
与我相关
我的任务
分享
create table student(studentId int,studentName varchar(20),degree int)
insert into student
select 1,'张三',80
union all
select 2,'李四',85
union all
select 3,'王二',64
union all
select 4,'刘强',67
union all
select 5,'胡为',72
union all
select 6,'钟杨',93
union all
select 7,'罗文',76
union all
select 8,'张彬',86
union all
select 9,'王云',88
select top 1 * from
(
select top 6 *
from student
order by degree )T
order by degree desc
select top 1 *
from(select top 6 * from student order by DEGREE DESC) T
order by DEGREE
select * from student a where (select count(DEGREE) from student where DEGREE>a.DEGREE) = 5