Use 0 and '' is not NULL : NULL « Data Types « MySQL Tutorial






mysql>
mysql> SELECT 0 IS NULL, 0 IS NOT NULL, '' IS NULL, '' IS NOT NULL;
+-----------+---------------+------------+----------------+
| 0 IS NULL | 0 IS NOT NULL | '' IS NULL | '' IS NOT NULL |
+-----------+---------------+------------+----------------+
|         0 |             1 |          0 |              1 |
+-----------+---------------+------------+----------------+
1 row in set (0.00 sec)








10.18.NULL
10.18.1.NULL means 'a missing unknown value'
10.18.2.Use the IS NULL and IS NOT NULL operators for NULL value
10.18.3.In MySQL, 0 or NULL means false and anything else means true.
10.18.4.Two NULL values are regarded as equal in a GROUP BY
10.18.5.NULL values are presented first if you do ORDER BY ... ASC
10.18.6.NULL values are presented last if you do ORDER BY ... DESC
10.18.7.Use 0 and '' is not NULL