Skip to content

Instantly share code, notes, and snippets.

@acapps
Created September 14, 2016 22:24
Show Gist options
  • Save acapps/6e56aea0b22d8f79251f2ea7c12e773c to your computer and use it in GitHub Desktop.
Save acapps/6e56aea0b22d8f79251f2ea7c12e773c to your computer and use it in GitHub Desktop.
SQL, at least one result exists.
SELECT EXISTS(SELECT 1 FROM table_name WHERE id = 1);
If it id exists then it will return 1 otherwise it will return 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment