Created
June 26, 2014 13:02
-
-
Save masolino/753175dfd56908f969ab to your computer and use it in GitHub Desktop.
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 * FROM ( | |
(SELECT people.id AS person_id, people.email AS person_email, people.name AS person_name, results.title AS result_title, results.id AS result_id | |
FROM people, contents AS results, downloads | |
WHERE results.id = 166674 | |
AND downloads.content_id = results.competition_id | |
AND downloads.person_id = people.id) | |
UNION | |
(SELECT people.id AS person_id, people.email AS person_email, people.name AS person_name, results.title AS result_title, results.id AS result_id | |
FROM people, contents AS results, resource_visits | |
WHERE results.id = 166674 | |
AND resource_visits.competition_id = results.competition_id | |
AND resource_visits.person_id = people.id) | |
) AS email |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment