MySQL: NOT IN with sub select not working as expected?
问题 This is my query: SELECT customer_email FROM sales_flat_order WHERE customer_email NOT IN (SELECT customer_email FROM sales_flat_order WHERE status != 'holded'); There are 3 rows with status holded for my test customer_email test@example.com, no other status for that mail. For some reason, the full query returns no matches. When I fill the NOT IN manually like that, it works, I get my 3 rows: SELECT customer_email FROM sales_flat_order WHERE customer_email NOT IN ('whatever', 'foobar', '123