Advertisement
ran5000

Untitled

Mar 9th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.63 KB | None | 0 0
  1. insert into active_users (`user_id`) select users.id from users inner join twitter_identities on users.persona_id = twitter_identities.persona_id
  2. and twitter_identities.followers_count < 70000
  3. and users.id in (select
  4.             profile_collaborators.user_id
  5.         from
  6.             accounts
  7.                 join
  8.             profile_collaborators
  9.                 join
  10.             business_profiles ON accounts.id = profile_collaborators.account_id and accounts.active_business_profile_id = business_profiles.id
  11.         where
  12.             accounts.last_request_at > '2013-01-01 00:00:00' or business_profiles.subscription_type != 'free')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement