MySQL FULL JOIN not working but RIGHT and LEFT join works

China☆狼群 提交于 2019-11-29 09:59:56

Take a look at this How to simulate FULL OUTER JOIN in MySQL. It may helps.

FULL OUTER JOIN won't support in mysql.

You can emulate FULL OUTER JOIN using UNION (from MySQL 4.0.0 on):

with two tables usersXstats,usersXstats_alltime

SELECT * FROM usersXstats
LEFT JOIN usersXstats_alltime ON usersXstats.userId= usersXstats_alltime.userId
UNION
SELECT * FROM usersXstats
RIGHT JOIN usersXstats_alltime ON usersXstats.statId= usersXstats_alltime.statId
rajesh
SELECT Person1.Firstname, Person2.State
FROM Person1
left JOIN Person2
ON Person1.PersonID=Person2.PersonID
UNION
SELECT Person1.Firstname, Person2.State
FROM Person1
right JOIN Person2
ON Person1.PersonID=Person2.PersonID;

is working superbly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!