Created
August 16, 2016 09:25
-
-
Save mdauphin/c92567528e900be9b2c3a2a89dbb23eb to your computer and use it in GitHub Desktop.
Retrieve all emails for sugarcrm users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Retrieve all emails for sugarcrm users | |
SELECT user_name, email_addresses.email_address | |
FROM `users` | |
JOIN email_addr_bean_rel on bean_id = users.id | |
JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id | |
WHERE status = 'Active' and user_hash is not null and users.deleted = 0 and email_addresses.invalid_email = 0 | |
order by user_name ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment