Home > Database > Mysql Tutorial > What is the difference between mysql full join and oracle full join query

What is the difference between mysql full join and oracle full join query

WBOY
Release: 2023-06-09 14:31:46
forward
1111 people have browsed it

The difference between mysql full join query and oracle full join query

Oracle’s full join query can directly use full on, but there is no full join in mysql. Mysql uses union to implement full join

oracle's full connection

select * from a full join b on a.id = b.id
Copy after login

mysql's full connection

select * from a left join b on a.id = b.id
union
select * from a right join b on a.id = b.id
Copy after login
  • Note: mysql uses left connection and right connection to query separately Extract the data on the left and right sides

  • Then use union to merge (remove duplicate data on both sides)

Full connection means querying both The union of the query results of two tables

What is the difference between mysql full join and oracle full join query

Inner join or equivalent join is to query the intersection of two tables

What is the difference between mysql full join and oracle full join query

  • Left (outer) connection

What is the difference between mysql full join and oracle full join query

  • ##Right (outer) connection

What is the difference between mysql full join and oracle full join query

Full connection problem in oracle

Data in the database:

What is the difference between mysql full join and oracle full join query

Full join:

Full outer join returns all rows in the left and right tables.

When a row has no matching row in another table, the select list column of the other table contains null values.

If there are matching rows between tables, the entire result set row contains the data values ​​of the base table.

select * from book as a full outer join stu as b on a.sutid = b.stuid
Copy after login
Result:

What is the difference between mysql full join and oracle full join query

The above is the detailed content of What is the difference between mysql full join and oracle full 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