mysql 自动记录数据最后修改时间
-- mysql ,还真有这样的说法; mysql> create table test( -> name varchar(10), -> uptime timestamp on update current_timestamp -> ); Query OK, 0 rows affected (0.02 sec) mysql> mysql> insert into test(name ,uptime) values('zhang',now()- 1); Query OK, 1 row affected (0.01 sec) mysql> mysql> select * from test ; +-------+---------------------+ | name | uptime | +-------+---------------------+ | zhang | 2016-02-25 11:30:23 | +-------+---------------------+ 1 row in set (0.00 sec) mysql> update test set name = 'lisi'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from test ; +------+---------------------+ | name | uptime | +------+---------------------+ | lisi | 2016-02-25 11:30:24 | +------+---------------------+ 1 row in set (0.00 sec) mysql> mysql> drop table test ; Query OK, 0 rows affected (0.01 sec) mysql> mysql>
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步