Home >Database >Mysql Tutorial >About mysql implementation of table join (left, right, inner, full join)
mysql implements table connection (left, right, inner, full join)
The connection between two tables appears in the query. The following uses examples to explain the differences between various connection queries
Table a, and table b are as shown below
a has abcd in the table
in the table
SELECT * from a INNER JOIN b on a.name=b.id;The result is as shown in the figure, select the equivalent result (abc)
SELECT * from a left JOIN b on a.name=b.id;The query results are as shown in the figure, select table a as the benchmark. (abcd)
SELECT * from a right JOIN b on a.name=b.id;The query results are as shown in the figure, select table a as the benchmark. (abcf)
(SELECT * from a left JOIN b on a.name=b.id) UNION (SELECT * from a RIGHT JOIN b on a.name=b.id );The result is that all are displayed , as shown below:
https://www.php.cn/course/list/51.html
The above is the detailed content of About mysql implementation of table join (left, right, inner, full join). For more information, please follow other related articles on the PHP Chinese website!