Updating entry WITHOUT updating timestamp

前端 未结 5 457
旧时难觅i
旧时难觅i 2020-12-02 16:38

I have a timestamp in a mysql table with attribute \"ON UPDATE CURRENT_TIMESTAMP\". Is there a way to manually disable updating the timestamp on a special occasion? (eg: upd

5条回答
  •  一生所求
    2020-12-02 17:10

    You can manually set the value of the column to its current value in the update command:

    UPDATE table SET x=y, timestampColumn=timestampColumn WHERE a=b;
    

    If you don't set the value in the query, it will be updated to the current timestamp as per the table definition.

提交回复
热议问题