I have a MySQL table and a column of type datetime. It’s default value is something like 0000-00-00 00:00:00.
How do I check if a given row’s value on this datetime column is the above by using native MySQL query functionality. E.g. without using “SELECT * FROM table WHERE my_date<>’0000-00-00 00:00:00′”, because this leaves room for errors on different MySQL servers and configurations I believe.
You can test it with
which returns
true(andfalsefor all otherdatetimevalues).