Skip to content

Instantly share code, notes, and snippets.

@PoTHuYJoHN
Last active December 19, 2015 21:48
Show Gist options
  • Save PoTHuYJoHN/6022244 to your computer and use it in GitHub Desktop.
Save PoTHuYJoHN/6022244 to your computer and use it in GitHub Desktop.
Get elements from the same table where parent_id does not exists
SELECT * FROM help as t1 left JOIN help as t2 ON t1.parent_id = t2.id WHERE t2.id IS NULL AND t1.isCategory = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment