Greetings,
I'm a bit surprised that these two queries give different results:
SELECT a.number, a.name , b.*
FROM Atable a
LEFT OUTER JOIN Btable b
JOIN Ctable c ON c.number = b.number
ON b.number = a.number
ORDER BY a.number;
SELECT a.number, a.name , b.*
FROM Atable a
LEFT OUTER JOIN Btable b ON b.number = a.number
JOIN Ctable c ON c.number = b.number
ORDER BY a.number
My expectation is that both of these would return the results that the first query does. The first query returns every row from TableA; the second row only returns results from TableA if they also exist in TableC.
Why does the join from C to B restrict TableA in the second query but not in the first query?
Thanks!
I'm a bit surprised that these two queries give different results:
SELECT a.number, a.name , b.*
FROM Atable a
LEFT OUTER JOIN Btable b
JOIN Ctable c ON c.number = b.number
ON b.number = a.number
ORDER BY a.number;
SELECT a.number, a.name , b.*
FROM Atable a
LEFT OUTER JOIN Btable b ON b.number = a.number
JOIN Ctable c ON c.number = b.number
ORDER BY a.number
My expectation is that both of these would return the results that the first query does. The first query returns every row from TableA; the second row only returns results from TableA if they also exist in TableC.
Why does the join from C to B restrict TableA in the second query but not in the first query?
Thanks!