In the following example, I am getting all the values greater than '2009-11-29' as well as NULL and '0000-00-00'. Is there any other way to get the same results?
mysql>select * from totest;
+---------------------+
| stime |
+---------------------+
| 0000-00-00 00:00:00 |
| 2009-12-12 12:22:32 |
| 0000-00-00 00:00:00 |
| 2009-01-12 12:22:32 |
| 0000-00-00 00:00:00 |
| NULL |
+---------------------+
6 rows in set (0.00 sec)
mysql>select * from totest where If(stime!='0000-00-00', stime >= '2009-11-29', 1);
+---------------------+
| stime |
+---------------------+
| 0000-00-00 00:00:00 |
| 2009-12-12 12:22:32 |
| 0000-00-00 00:00:00 |
| 0000-00-00 00:00:00 |
| NULL |
+---------------------+
5 rows in set (0.00 sec)