var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Newbie select question
I have 2 tables with email addresses. I need to get the email addresses from the "old" table that are not in the "new" table. A DBA I know suggested:
SELECT Email FROM Old WHERE Email NOT IN (SELECT Email FROM New)
It did not work.
What does "it did not work" mean?
Did you get no results? Did you get an error message?
what version of MySQL are you running?
I got an error message pointing to the SELECT in the ().
I am running 3.23.58
The reason you are getting an error message is that you can't use subqueries before version 4.1
You can do this with a join though:
FROM oldtable AS old
LEFT OUTER JOIN
newtable as new
ON old.oldemailaddress = new.newemailaddress
WHERE new.newemailaddress IS NOT NULL
Not quite, but close. For the sake of anyone reading this later the following worked:
SELECT old.email FROM oldemail AS old LEFT OUTER JOIN newemail AS new ON old.email = new.email WHERE new.Email IS NULL
Thanks for the help!!