How to Force UPDATE of MySQL Record When Nothing I

2019-02-26 03:47发布

My database table has a column defined to use ON UPDATE CURRENT_TIMESTAMP:

  • Field: last_access
  • Type: timestamp
  • Collation:
  • Attributes: on update CURRENT_TIMESTAMP
  • Null: No
  • Default: CURRENT_TIMESTAMP
  • Extra: ON UPDATE CURRENT_TIMESTAMP

How can I force this last_access field to update for a given record when no other data in the record is changing?

1条回答
仙女界的扛把子
2楼-- · 2019-02-26 04:38

UPDATE your_table SET last_access = CURRENT_TIMESTAMP(); ?

查看更多
登录 后发表回答