Skip to content

Instantly share code, notes, and snippets.

@ychaouche
Created November 20, 2012 14:06
Show Gist options
  • Select an option

  • Save ychaouche/4118137 to your computer and use it in GitHub Desktop.

Select an option

Save ychaouche/4118137 to your computer and use it in GitHub Desktop.
search a contact with by email address in sugarcrm
SELECT contacts.first_name, contacts.last_name
FROM
contacts
WHERE contacts.id
IN
(
SELECT email_addr_bean_rel.bean_id
FROM email_addr_bean_rel
JOIN email_addresses
ON email_addr_bean_rel.email_address_id = email_addresses.id
WHERE
email_addresses.email_address = 'ychaouche@feeder.fr'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment