In mysql, how does one judge datetime as null?

Source: Internet
Author: User
In mysql, how does one determine that the time field datetime is null? in mysql, the initial value of the time field datetime is 0000-00-. how does one determine that it is null? if it is null, it is updated to the system time; otherwise, it is not updated, judge a table's field = 0000-00-. if it is waiting, it will be updated. Otherwise, it will not be updated? Why do we have to judge whether it is null? In mysql, how does one judge datetime as null?
In mysql, the initial datetime Value of the time field is 0000-00-00 00:00:00.
How to judge if it is null
Update to system time if it is null
Otherwise, it will not be updated.



------ Solution --------------------
Judge the field of a table = 0000-00-00 00:00:00. if it is waiting, it will be updated; otherwise, it will not be updated.
Is that all right? Why do we have to judge whether it is null?
------ Solution --------------------
It seems that there is no better way to determine whether the strings are equal.
------ Solution --------------------
Yes.
Discussion
It seems that there is no better way to determine whether the strings are equal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.