一、内连接 —— INNER JOIN
内连接是最常见的一种连接,只连接匹配的行。
表1:
表2:
执行查询:
select StudentId as 学生编号,StudentName as 姓名,Gender as 性别,Likes as 爱好,ClassName as 所在班级 from Students a inner join Class b on a.ClassID = b.ClassId
效果:
2024-01-27 16:08:06
内连接是最常见的一种连接,只连接匹配的行。
表1:
表2:
执行查询:
select StudentId as 学生编号,StudentName as 姓名,Gender as 性别,Likes as 爱好,ClassName as 所在班级 from Students a inner join Class b on a.ClassID = b.ClassId
效果: