Home > Database > Mysql Tutorial > How to use mysql union to implement full outer join query

How to use mysql union to implement full outer join query

WBOY
Release: 2023-05-30 18:49:06
forward
1211 people have browsed it

1. Union is not a method of multi-table connection query. It combines the query results of multiple query sentences into one result and removes duplicate data.

2. Full outer join queries the data of the left table and the right table, and then connects according to the connection conditions.

Example

# 用左外的A union 右外的B
SELECT * FROM t_category c LEFT OUTER JOIN t_product p ON c.cid = p.cno
union
SELECT * FROM t_category c RIGHT  OUTER JOIN t_product p ON c.cid = p.cno
Copy after login

The above is the detailed content of How to use mysql union to implement full outer join query. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template