1,618
社区成员
发帖
与我相关
我的任务
分享select t.* from
(
select subject , studentid , avg(score) score from tb group by subject , studentid
) tb t
where score in
(
select top 10 score from (select subject , studentid , avg(score) score from tb group by subject , studentid) m where subject=t.subject order by score desc
)
order by subject , score descselect * from tb t
where score in
(
select top 10 score from tb where subject=t.subject order by score desc
)
order by subject , score desc