如何设置MySQL中两列的默认值为当前时间戳?

2026-06-09 12:443阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计32个文字,预计阅读时间需要1分钟。

如何设置MySQL中两列的默认值为当前时间戳?

sqlALTER TABLE qssqMODIFY COLUMN createdAt TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;

如何设置MySQL中两列的默认值为当前时间戳?


alter table qssq
change createdAt newtime timestamp null default current_timestamp