Jump to content

Full Outer Join


Basti86

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.