Will the CURRENT_TIMESTAMP column be updated even if I UPDATE some other column in the row?
views:
47answers:
1
+3
A:
Yes, if you set the auto-update value to be CURRENT_TIMESTAMP
, it will always update, regardless of which columns you updated. You don't have to specify the field and set it to CURRENT_TIMESTAMP
, as it will do it on its own.
Be advised that you cannot have one column with a default value of CURRENT_TIMESTAMP
and another column with the auto-update value of CURRENT_TIMESTAMP
.
See more in the MySQL docs here.
Eric
2009-07-17 02:01:09