Multiple timestamp errors in a single mysql table #1293

Source: Internet
Author: User
Mysql returns an error when multiple timestamp entries exist in a single table #1293 bitsCN.com


Mysql single table multiple timestamp error #1293-Incorrect table definition; there can be only one TIMESTAMP column with C solution

When multiple timestamps are displayed in a table and one of them is set to current_timestamp

#1293-Incorrect table definition; there can be only oneTIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATEclause

The reason is that when you set a timestamp to on updatecurrent_timestamp, other timestamp fields need to explicitly set the default value.

However, if you have two timestamp fields, but only set the first one to current_timestamp, and the second to do not set the default value, mysql can also successfully create a table, but in turn it won't work...

N. b: The above explanation is online. In fact, on updatecurrent_timestamp (the "refresh current timestamp" option in the Chinese version of navicat) can only be set to one or not set, you cannot set two or more.

BitsCN.com

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.