Hello
I have two tables a Master and Child. I want to return a recordset that has all of the Master records and any related child values.
Sample Data:
Master Table
'id' 'field1'
1 Test1
2 Test2
3 Test3
Child Table
'id' 'masterID' 'field1'
1 2 Child1The following code will only return one record:
SELECT master.id, master.field1, child.field1
FROM master INNER JOIN child on master.id = child.masterID
WHERE child.id = 1
Resulting recordset:
2,Test2, Child1
What I need to achieve is:
Resulting recordset:
1,Test1,NULL
2,Test2,Child1
3,Test3,NULL
I hope that makes sense. I am not even sure if it is possible.
I have tried using various OUTER JOIN combinations but the result is the same.
Regards
James