insert into active_users (`user_id`) 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'