立即学习:https://edu.csdn.net/course/play/27328/362530?utm_source=blogtoedu
1、表连接
#表连接语法
SELECT table1.column,table2.column
FROM table1,table2
WHERE table1.column1 = table2.column2;
表连接包括:
内连接、自连接、外连接
实际应用中,掌握内连接和左连接就可。
#内连接的语法
select A.stu_no,A.name,B.course,B.score
from student A
join/inner join score B on (A.stu_no = B.stu_no);
select A.stu_no,A.name,B.course,B.score
from student A, score B
where A.stu_no = B.stu_no;
#左连接语法
select A.stu_no,A.name,B.course,B.score
from student A
left join score B on (A.stu_no = B.stu_no);