Skip to content

Instantly share code, notes, and snippets.

@eit
Created May 24, 2013 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eit/5641797 to your computer and use it in GitHub Desktop.
Save eit/5641797 to your computer and use it in GitHub Desktop.
SELECT user_id
FROM `facebook_active_user_201303`
WHERE page_id = '145649977189'
AND startdate = '2013-03-01'
AND period = 'month'
AND user_id
IN
(
SELECT user_id
FROM `facebook_active_user_201303`
WHERE page_id = '152341009257'
AND startdate = '2013-03-01'
AND period = 'month'
)
SELECT user_id
FROM `facebook_active_user_201303`
WHERE (
page_id = '145649977189'
OR page_id = '152341009257'
)
AND startdate = '2013-03-01'
AND period = 'month'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment