1
select a.*,b.score as 01_score,c.score as 02_score from student a,sc b,sc c
where a.SId=b.SId
and b.SId=c.SId
and b.CId='01'
and c.CId='02'
and b.score>c.score
SELECT t.*,student.Sage,student.Sname,student.Ssex
FROM
(
SELECT sc1.SId,sc1.score 01score,sc2.score 02score
FROM sc sc1,sc sc2
WHERE sc1.SId=sc2.SId AND sc1.score>sc2.score AND sc1.CId='01'AND sc2.CId='02'
) AS t
LEFT JOIN student
ON t.SId=student.SId
2
未完待續(xù)球匕。昔馋。五芝。