Skip to content

Instantly share code, notes, and snippets.

@davletyarov
Created May 24, 2019 16:23
Show Gist options
  • Save davletyarov/0c15b2921a1eab2f5e2af0e393300618 to your computer and use it in GitHub Desktop.
Save davletyarov/0c15b2921a1eab2f5e2af0e393300618 to your computer and use it in GitHub Desktop.
SELECT *
FROM category c
WHERE NOT EXISTS(SELECT * FROM category s WHERE s.parent_category_id = c.id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment