I need to combine two tables together based on a common column. Normally I would just use an inner join on the specific column (lets call it parentID), but I need the results to be in seperate rows.
Table A:
ID, ...
Table B:
ID, ParentID, SomeColB, ...
Table C:
ID, ParentID, SomeColC, ...
ParentID points to the ID of table A. The result should look as follows:
ParentID ID_A ID_B SomeColB SomeColC
1 10 20 'VAL_B1' NULL
1 10 20 NULL 'VAL_C1'
2 11 21 'VAL_B2' NULL
2 11 21 NULL 'VAL_C2'
...
So I want to alternate between selecting values from Table B and C and leave the remaining columns on null. How would I do that?
I tried joining them together but this results in results being put into a single row.
EDIT: Both Table B and C have a 1-n relationship to table A (one entry in table a can be referenced from multiple entries in table B and C). Table B and C don't reference each other and are completely independent of eachother.