Last active
December 11, 2015 19:39
-
-
Save rossmartin/4650090 to your computer and use it in GitHub Desktop.
MySQL Combine Two Statements With LIMITs using UNION
This file contains 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 'lab' AS table_name, id FROM table1 | |
WHERE organizerClassId = '4013-5' LIMIT 1) | |
UNION | |
(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