Skip to content

Instantly share code, notes, and snippets.

@rossmartin
Created January 27, 2013 20:19
Show Gist options
  • Save rossmartin/4650226 to your computer and use it in GitHub Desktop.
Save rossmartin/4650226 to your computer and use it in GitHub Desktop.
Web SQL UNION with multiple LIMITs
SELECT * FROM (
SELECT 'lab' AS table_name, id FROM table1
WHERE organizerClassId = '4013-5' LIMIT 1)
UNION
SELECT * FROM (
SELECT 'rad' AS table_name, id FROM table2
WHERE organizerClassId = '4013-5' LIMIT 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment