See? I forgot to do one yesterday, but at least I remembered to catch up…
This is more of a SQL optimisation trick. You sometimes need to get a result set containing items NOT in another result set. The obvious code would be:
WHERE myTableId NOT IN (SELECT myTableId FROM myOtherTable)
…but that sometimes generates rather poor query plans. An alternative is:
FROM myTable M
LEFT JOIN myOtherTable O ON M.myTableId = O.myTableId
WHERE O.myTableId IS null
One obvious consequence is that you’ll get more columns available, so don’t really use * in your select.
Compare your query plans and see which one is better for you.