This has to be so simple, but my solution runs much slower than I would expect it to. I'm wondering if there is a more efficient way to do this type of query.

I have a table of email messages, I have another table containing all of the email addresses linked to each email message

I want to search for email messages in the email mesasge table that have both "[EMAIL PROTECTED]" and "[EMAIL PROTECTED]" as recipients in the address table

select * from mailarchive, addresses as address1, addresses as address2
where
(
mailarchive.MailArchiveRecordID=address1.emaillink
and
mailarchive.MailArchiveRecordID=address2.emaillink
)
and
address1.emailaddress=\"[EMAIL PROTECTED]"
and
address2.emailaddress=\"[EMAIL PROTECTED]" "


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to