A-A+
查询存在 01 课程但可能不存在 02 课程的情况(不存在时显示为 null ) select * from (select SC.SId SC.score from SC where SC.CId = '01') as t1 left join (select SC.SId SC.score from SC where SC.CId = '02') as t2 on t1.SId = t2.SId
问题详情
查询存在" 01 "课程但可能不存在" 02 "课程的情况(不存在时显示为 null ) select * from (select SC.SId, SC.score from SC where SC.CId = "01") as t1 left join (select SC.SId, SC.score from SC where SC.CId = "02") as t2 on t1.SId = t2.SId
参考答案
select *from Coursewhere CID = 001 or CID = 002