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
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
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
Inner join or equivalent join is to query the intersection of two tables
Left (outer) connection
Data in the database:
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
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!