Created
May 13, 2013 08:55
-
-
Save ismaGNU/5567033 to your computer and use it in GitHub Desktop.
SELECT and check if exist column in another table
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 | |
*, CASE WHEN EXISTS ( | |
SELECT * FROM campaigns c | |
WHERE c.ev_id = e.ev_id) THEN 1 ELSE 0 END AS promoted | |
FROM | |
eventos e | |
WHERE | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment