1
如何来当我更新一列但另一列(时间戳)也自动地与系统当前时间MySQL的柱(时间戳)也自动地与系统当前时间更新
数据库MySQL的更新:
例如SQL我excuted
select id, processstatus, processtimestamp from mytable where id=229;
id processstatus processtimestamp
--------- ---------------------------------------------------------------------------------------------------- -------------------------
229 EXPORT_FILEA.txt 2015-11-04 12:54:49.0
update mytable set processstatus='EXPORT_TO_FILE_B' where id=229;
select id, processstatus, processtimestamp from mytable where id=229;
id processstatus processtimestamp
--------- ---------------------------------------------------------------------------------------------------- -------------------------
229 EXPORT_TO_FILE_B 2015-11-04 13:09:41.0
你想要的列进行更新或没有? –
我不希望列(processtimestamp)自动更新。此列不应该使用current_timestamp自动更新,因为它不会被创建为非空default current_timestamp;它只被创建为非空 – stewchicken
尝试@Rahautos第二个查询 –