且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

一个SQL题

更新时间:2022-10-01 08:58:42

题目如图:

一个SQL题

模拟题目建的表如下图:

一个SQL题

答案:

select t3.id,t3.name,max(t3.score) from (
select t1.* from b t1,(select id,max(score) score from b group by id) t2 where t1.id=t2.id and t1.score<t2.score
) t3 group by t3.id;


本文转自屌丝逆袭博客51CTO博客,原文链接http://blog.51cto.com/5731674/1768128如需转载请自行联系原作者

_追随我心