I was trying to RIGHT JOIN two tables using this query
SELECT Persons.firstname, company.lastname
FROM Persons
RIGHT JOIN company ON Persons.firstname=company.firstname;
which comes with this error-
RIGHT and FULL OUTER JOINs are not currently supported
How can we get rid of this ?
Note: I am using Mozilla DB manager.
MySQL does not support full outer join out of the box, unlike other databases such as PostgreSQL, and SQL Server. So you will need to do a full outer join using a combination of other join types such as LEFT JOIN ad RIGHT JOIN that are supported in MySQL.
You're getting that error because MySQL does not support (or recognize) the FULL OUTER JOIN syntax. However, it is possible emulate a FULL OUTER JOIN in MySQL. We actually need two queries. One query return all the rows from the table on the left.
Unfortunately, SQLite does not support the RIGHT JOIN clause and also the FULL OUTER JOIN clause. However, you can easily emulate the FULL OUTER JOIN by using the LEFT JOIN clause.
SQLite does not directly support the RIGHT JOIN and FULL OUTER JOIN.
By doing a left join
and switching the tables
SELECT Persons.firstname, company.lastname
FROM company
LEFT JOIN Persons ON Persons.firstname = company.firstname;
For FULL OUTER JOIN UNION the result of LEFT and RIGHT( again swapped LEFT JOIN) JOIN results...
SELECT Persons.firstname,company.lastname FROM Persons LEFT JOIN company ON
Persons.firstname=company.firstname
union
SELECT Persons.firstname, company.lastname FROM company LEFT JOIN Persons ON
Persons.firstname=company.firstname;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With