题目如图:
模拟题目建的表如下图:
答案:
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;
时间: 2024-10-09 11:34:01
题目如图:
模拟题目建的表如下图:
答案:
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;