-------------------------------------------插入数据时自动更新时间戳---------------------
CREATE TABLE `time_smp_test01` (
 `id` int NOT NULL auto_increment,
 `name` varchar(255),
 `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY (`id`)
 ) COMMENT='';
------------------------------------------更新数据时自动更新时间戳-------------------------
CREATE TABLE `time_smp_test02` (
 `id` int NOT NULL auto_increment,
 `name` varchar(255),
 `update_time` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY (`id`)
 ) COMMENT='';
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2021-11-20
  • 2022-02-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
相关资源
相似解决方案