
In this post, we will understand the difference between left outer join, right outer join, and full outer join.
It fetches all the rows from the table on the left.
It is same as ‘Inner Join + all the unmatched rows from the left table’.
The data that isn’t matched on the right table is lost.
SELECT [column_1, column_2, ….] FROM table_1 LEFT OUTER JOIN table_2 ON table_1.matching_column = table_2.matching_column
It fetches all the rows of the table on the right.
It is similar to performing ‘Inner Join + all of the unmatched rows from the right table’.
The unmatched data from the left table is lost.
SELECT [column_1, column_2, ….] FROM table_1 RIGHT OUTER JOIN table_2 ON table_1.matching_column = table_2.matching_column
它从两个表中获取所有的行。
它类似于执行“内连接 + 左表中所有不匹配的行 + 右表中所有不匹配的行”。
在此操作中不会丢失任何数据。
SELECT [column_1, column_2, ….] FROM table_1 FULL OUTER JOIN table_2 ON table_1.matching_column = table_2.matching_column
以上就是左、右和完全外连接之间的区别的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号