MySQL FULL JOIN not working but RIGHT and LEFT join works

后端 未结 4 1595
遥遥无期
遥遥无期 2020-12-19 03:20

This is driving me nuts. I have two tables that I am attempting to preform a join on, usersXstats and usersXstats_alltime.

Both tables have the same columns: id, us

4条回答
  •  心在旅途
    2020-12-19 03:47

    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.

提交回复
热议问题