Loading... How do SQL Joins Work? The diagram below shows how 4 types of SQL joins work in detail. * INNER JOIN Returns matching rows in both tables. * LEFT JOIN Returns all records from the left table, and the matching records from the right table. * RIGHT JOIN Returns all records from the right table, and the matching records from the left table. * FULL OUTER JOIN Returns all records where there is a match in either left or right table. 下图显示了 4 种类型的 SQL 连接的详细工作原理。 * 内连接 返回两个表中的匹配行。 * 左连接 返回左表中的所有记录以及右表中的匹配记录。 * 右连接 返回右表中的所有记录以及左表中的匹配记录。 * 全外连接 返回左表或右表中存在匹配项的所有记录。 ![SaveTwitter.Net_GBFHfHzbkAIJZ8r.jpg][1] [1]: https://www.sddts.cn/usr/uploads/2023/12/706587862.jpg 最后修改:2024 年 05 月 11 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏