I have a problem with FULL JOIN keyword used in MySQL
SELECT Name,Surname,Notes.Payment FROM Persons FULL JOIN Notes ON Persons.id=Notes.P_Id
it give me this error :
Unknown column 'Persons.id' in 'on clause'
but if I call with LEFT JOIN or RIGHT JOIN, the results appear properly.
What is the problem with FULL JOIN ?
Thank you
MySQL does not (yet) support FULL JOIN
.
Use something like this:
SELECT Name, Surname, Notes.Payment
FROM Persons
LEFT JOIN Notes
ON Persons.id = Notes.P_Id
UNION ALL
SELECT Name, Surname, Notes.Payment
FROM Persons
RIGHT JOIN Notes
ON Persons.id = Notes.P_Id
WHERE Persons.id IS NULL
The error you get is because FROM Persons FULL JOIN Notes ON
is parsed as:
FROM Persons AS FULL
JOIN Notes
ON ...
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