0

Hi I am having the following query:

SELECT *
FROM `workshopmails`
WHERE `workshopmails_mail` NOT
IN (

SELECT workshopklanten_email
FROM `workshopklanten`
)
GROUP BY workshopmails_mail
ORDER BY `workshopmails`.`workshopmails_datum` DESC

But although i know this should give a lot of results it gives the message:

MySQL returned an empty result set (0 rows).

I tried it with an older database and got 100+ results now with my newer data it wont work any more the only thing i can think of is because there are some NULL values in it, that where not in the older database

Does anyone know a solution so i can extract the emails?

Thx Matthy

matthy
  • 8,144
  • 10
  • 38
  • 47

1 Answers1

0

Thanks to Martin Smith

NOT IN (SELECT workshopklanten_email FROM workshopklanten WHERE workshopklanten_email IS NOT NULL) 

would be one way.

SQL NOT IN not working

Community
  • 1
  • 1
matthy
  • 8,144
  • 10
  • 38
  • 47