>This construct scares me:
>IN (1, NULL)
>NULL is generally not treated as a "value" that can be compared.
This construct looks ok to me. In MySQL, 0 or NULL means false and anything else means true, here is the test case:
mysql> select 1 IN (1,NULL), 1 IN (2,NULL), 1 IN(2,3), NULL IN(2,3);
+---------------+---------------+-----------+--------------+
| 1 IN (1,NULL) | 1 IN (2,NULL) | 1 IN(2,3) | NULL IN(2,3) |
+---------------+---------------+-----------+--------------+
| 1 | NULL | 0 | NULL |
+---------------+---------------+-----------+--------------+
1 row in set (0.00 sec)
can you please explain what's your concern?
Edited 2 time(s). Last edit at 07/05/2012 03:37AM by Aftab Khan.