Bug #21230 | Problem with Not in and Null values | ||
---|---|---|---|
Submitted: | 22 Jul 2006 15:19 | Modified: | 23 Jul 2006 14:24 |
Reporter: | Andres Felipe Gutierrez | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.21 | OS: | Any (all) |
Assigned to: | CPU Architecture: | Any | |
Tags: | null, subquery |
[22 Jul 2006 15:19]
Andres Felipe Gutierrez
[22 Jul 2006 23:02]
Peter Laursen
Hello! I think that you are doing the same mistake as I did here: http://bugs.mysql.com/bug.php?id=19635 There is nothing = NULL and nothing <> NULL. But thanks for your case. It is very illustrative!
[23 Jul 2006 1:22]
MySQL Verification Team
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Please read: http://dev.mysql.com/doc/refman/5.0/en/problems-with-null.html
[23 Jul 2006 14:24]
Andres Felipe Gutierrez
I was readed documentation at 'http://dev.mysql.com/doc/refman/5.0/en/problems-with-null.html'; and I think that problem with 'not in' and '<> all' is about http://dev.mysql.com/doc/refman/5.0/en/rewriting-subqueries.html when the paragraph says: The queries: SELECT * FROM t1 WHERE id NOT IN (SELECT id FROM t2); SELECT * FROM t1 WHERE NOT EXISTS (SELECT id FROM t2 WHERE t1.id=t2.id); Can be be rewritten using IN(): SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id WHERE table2.id IS NULL; I think that everytime a query using 'left join' or 'not exists' should return the self than 'not in' or '<> all'