I am trying to better understand how "does not work" with WHERE in MySQL.
For instance:
SELECT * FROM current_mailing_list WHERE address1 NOT IN (select address1 from old_mailing_list) AND city not in (select city from old_mailing_list);
In the above example, the goal of the request is to list the new mailing addresses. address1 is the street address, for example 1234 N. Main St The problem arises when 1234 N. Main St occurs in more than one city, which can happen. So I decided to add city to it to make it more unique.
My question is: is this what I expect from him? So, he must find these street addresses (address1), which are not in old_mailing_list AND , then make sure that they have another city .
I did this simply with address1:
SELECT * FROM current_mailing_list WHERE address1 NOT IN (select address1 from old_mailing_list);
and he released a much larger list (about 10 times more). So I wanted to add city to this. Or is my logic completely wrong and needs a different approach?
source share