Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
SELECT *
FROM Table1
LEFT JOIN Table2 ON Table1.Col1 = Table2.Col1 AND Table1.Col2 = Table2.Col2
LEFT JOIN Table3 ON Table2.Col1 = Table3.Col1 AND Table2.Col2 = Table3.Col2
LEFT JOIN Table4 ON Table3.Col1 = Table4.Col1 AND Table4.Col2 = Table4.Col2
WHERE Table1.Col3 > 100

It's hard to make the same mistake in the second example because the left join type is more explicit and visible.

...