我做了两个表这样如何限制左连接?
degree_plan student_record
------------------------------ ----------------------------
major course course_no ID course_no grade
------------------------------ ----------------------------
COE COE200 1 4455 1 A
COE COE305 2 4455 2 C
COE COE400 3 3333 4 B
SWE SWE214 4
SWE SWE344 5
SWE SWE444 6
course_no
是我如何写SQL查询来给我这样where ID=4455 and the major = COE
--------------------------
major course grade
--------------------------
COE COE200 A
COE COE305 C
COE COE400 NULL
提示:'WHERE'。 '左加入'。 –
只需在course_no上进行内连接或左连接。查看一些关于这个连接的文档。 –
我试了左连接,但检索所有左边的tablel – Steven