17,086
社区成员
发帖
与我相关
我的任务
分享
select s1.score,s2.score from student st left join sc s1 on st.sid=s1.sid and s1.cid='01' left join sc s2 on st.sid=s2.sid and s2.cid='02' where s1.score>ifnull(s2.score ,0);
select t2.score,t3.score from student t1 left join sc t2 on t1.sid=t2.sid left join sc t3 on t1.sid=t3.sid where t2.score>ifnull(t3.score ,0) and t3.cid='02 ' and t2.cid='01';