0 votes
1 view
in SQL by (3.3k points)

I want to do a Full Outer Join in MySQL. Is this possible? Is a Full Outer Join supported by MySQL?

1 Answer

0 votes
by (6.8k points)

The full outer joins help to combine the results of both the right and the left outer join, which means that the resulted table contains all the records from both the table and invoking nulls to the records that have missing values.

 

Let’s have look at the structure of full outer join and how it is implemented in Mysql:

Consider two table  Employ and Student:

 

SELECT * FROM Employ

LEFT JOIN Student ON Employ.age = Student.age

UNION

SELECT * FROM Employ

RIGHT JOIN Student ON Employ.age = Student.age

The query will give you a result implementing full join and provide the joined table with distinct (does not contain duplicate value)records.

If you change the UNION keyword with UNION ALL, then it will return all the records including duplicate values.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Apr 23, 2020 in SQL by Sudhir_1997 (53.7k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...