Timestamp for row creation and last modification
问题 I need to keep track of the time a row was inserted into the database, and the time it was last modified. I tried to create two separate columns, and use CURRENT_TIMESTAMP : create table def ( id int, creation timestamp default CURRENT_TIMESTAMP, modification timestamp on update CURRENT_TIMESTAMP ); However, this produced an error: ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause What is the best way