Lately i been doing some work on my MySql class in php and as result of optimizing some parts of my code i would like to narrow some function count down.
I am really having hard time to work with 3 or more tables because it’s getting really confusing there. I don’t have a lot experience working with MySql or any other database, but i know the basics and little bit more.
And for the problem i can’t figure our how to make statement like so:
[table1 – users.email] AND [table2 – subscribers.email] NOT IN [table3 – check.email]
In words that would look like “Get me all unique user emails from [table1] and [table2] that are not in [table3] and put them in 1 list “
By 1 list i mean the same as this statement does it
SELECT u.email FROM users AS u UNION
SELECT s.email FROM subscribers AS s
Thanks in advance, please say if you need any more information.
You left join the 3rd table and then do “where t3.field IS NULL”
example:
You need to make this distinct as well to get unique results.