Current_timestamp and on UPDATE current_timestamp differences in MySQL database

Source: Internet
Author: User

, in the MySQL database, when the field type is TIMESTAMP, if the default value is Current_timestamp, when you insert a record, the value of End_time is automatically set to the current time of the system, if the on UPDATE is checked Current_ TIMESTAMP, the Time field is updated in real time with the update command, that is, End_time automatically updates to the latest time when the primary key primary key of the datasheet changes.

If Current_timestamp and on UPDATE Current_timestamp are set, the End_time automatically acquires the system time when a new row is created, and when the primary key of the line changes UPDATE, End_ Time is automatically updated to the system up-to-date.

Reference:

78145218

Current_timestamp and on UPDATE current_timestamp differences in MySQL database

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.