Advertisement
ran5000

Untitled

Sep 25th, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.44 KB | None | 0 0
  1. insert into active_personas (`persona_id`)
  2. select persona_id from users
  3. where id in (
  4. select profile_collaborators.user_id
  5. from accounts
  6. join profile_collaborators
  7. join business_profiles
  8. ON accounts.id = profile_collaborators.account_id
  9. and accounts.active_business_profile_id = business_profiles.id
  10. where accounts.last_request_at > '2012-07-01 00:00:00'
  11. or business_profiles.subscription_type != 'free')
  12. and persona_id is not null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement