Basti86 Posted June 19, 2008 Share Posted June 19, 2008 Good day, I am expiriencing a small problem with a mySQL statement. The problem is nothing new because I think it is about the missing FULL OUTER JOIN issue. I have read many workarounds but for some reason they just dont seem to work. I have a novice level knowhow of SQL but am eager to solve this problem( with your help ;> ). I have two tables. table A | id | structID | some more colums.. ----------------------------------- | 1 | 1 | | 1 | 2 | | 2 | 2 | table B | structID | name | other colums ----------------------------------- | 1 | AB | | 2 | BC | What I need to do is perform a SELECT on both tables and the result should be something like this: WHERE id = 2 |structID | id | name ---------------------------------- | 1 | null | AB | 2 | 2 | BC To keep it simple: I need a list of all structIDs and if they occured in the ID I sepcified. I tried it with an INNER LEFT JOIN but never received a NULL in any result.. Am I way off track, do I need to reorganize these tables or how can I accomplish what I want to do? -Greetings... Link to comment https://forums.phpfreaks.com/topic/110906-full-outer-join/ Share on other sites More sharing options...
Basti86 Posted June 19, 2008 Author Share Posted June 19, 2008 Arr, where is the edit button? My SQLStatement til now: SELECT * FROM tableB LEFT JOIN tableA ON tableB.structID = tableA.structID UNION ALL SELECT * FROM tableB RIGHT JOIN tableA ON tableB.structID = tableA.structID WHERE tableA.id IS NULL Link to comment https://forums.phpfreaks.com/topic/110906-full-outer-join/#findComment-569011 Share on other sites More sharing options...
fenway Posted June 19, 2008 Share Posted June 19, 2008 Your sample output is confusing... i see matching records for everything. Link to comment https://forums.phpfreaks.com/topic/110906-full-outer-join/#findComment-569338 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.