Search with comma-separated value mysql

Example of doing a join based on FIND_IN_SET

SELECT *
FROM imap_emails
INNER JOIN customers
ON FIND_IN_SET(customers.email, imap_emails.to) > 0

You don’t say how you want to narrow this down (ie, if an email uses 2 email addresses do you want both emails brought back), so can’t add much at this stage.

Leave a Comment