insert into active_personas (`persona_id`) select persona_id from users where id in ( select profile_collaborators.user_id from accounts join profile_collaborators join business_profiles ON accounts.id = profile_collaborators.account_id and accounts.active_business_profile_id = business_profiles.id where accounts.last_request_at > '2012-07-01 00:00:00' or business_profiles.subscription_type != 'free') and persona_id is not null;
Comments