Last active
August 29, 2015 14:06
-
-
Save ryanguill/6345f547e76278422049 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* useful if you dont have a real exception join */ | |
| /* this will return the records in a that are not in b on the join conditions in the left outer join */ | |
| select | |
| a.foo | |
| FROM | |
| a | |
| LEFT OUTER | |
| JOIN b | |
| ON a.id = b.id | |
| WHERE | |
| b.id IS NULL /* this must be in the where, which slows it down somewhat compared to a real exception join, but will be much faster than a NOT IN() */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment