Created
February 2, 2017 17:54
-
-
Save acapps/95762e539240259c3e7aa32a9c5b8385 to your computer and use it in GitHub Desktop.
MySQL select records that do not have relation with second table
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
SELECT * | |
FROM table_one | |
WHERE NOT EXISTS(SELECT * | |
FROM table_two | |
WHERE table_one.id = table_two.table_one_id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment