I have a query which works but am wondering if there is a better way to rewrite it at all.
The query is to find any email address in table1 that are missing from table2.
The MYSQL query is:
select
c.companyname
FROM table1 t1
JOIN table2 t2 on ( t2.hash = t1.recipient)
JOIN table3 t3 on (t3.hash = t1.customer)
WHERE
t2.deleted = 0
AND
t1.email NOT IN ( SELECT email from table2)
Is this as good as it can get?
Thanks