MySQL datetime Update, delete some old concepts on the Web

Source: Internet
Author: User

The old concept of the Internet

1th: The minimum value for the datetime of the previous MySQL is: ' 1000-01-01 00:00:00 ' (seemingly), but the latest MySQL test datetime minimum value can be: ' 0000-00-00 00:00:00 ' (0000-00-01 00:00:00 can also be inserted),

But I'm using ' 0001-01-01 00:00:00 ' as the minimum value (typically used instead of a null value as the default value for that column) because the datetime minimum value for C # is the value.

2nd: previously only TIMESTAMP types can be set to a default value of Current_timestamp, and only one TIMESTAMP column can be in a table.

But the newest MySQL, the datetime type can also set the default value is current_timestamp used to record the creation time of the row in the data table, and can add another column is a datetime type and the default value

The current_timestamp on update current_timestamp is used to record the updated time of rows in the data table, which are best set to NOT NULL.

MySQL datetime Update, delete some old concepts on the Web

Related Article

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.