Professional Documents
Culture Documents
SELECT parent.parent_key,
parent.data_1,
child.child_key,
child.parent_key
FROM child LEFT OUTER JOIN parent ON parent.parent_key = child.parent_key
ORDER BY parent.parent_key,
child.child_key;
Tip: Outer joins are confusing at the best of times, so dont make the situation
worse by using both LEFT OUTER JOIN and RIGHT OUTER JOIN operators. Stick
with LEFT OUTER JOIN and your code will be easier to understand because the
preserved table will always be on the same side.