Apache Doris 中文技术论坛
Questions Tags Users Badges

建表是如何实现create_time和update_time默认值

Asked Jul 17, 2024 Modified Jul 18, 2024
Viewed 235
2.1 ingestion

create_time DATETIME NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
使用insert 语句对相同的主键进行插入,会导致create_time发生变更,但是实际上是希望create_time不变,update_time时间变化,现在是两个时间都进行变化了。

edited Jul 18, 2024
____3
asked Jul 17, 2024
2 Answers

可以参考一下这个回答:【已解决】主键模型表指定部分列更新失败,未指定的默认列仍然被更新

edited Jul 18, 2024
黄海军@SelectDB5218
answered Jul 17, 2024

好像不是同个问题

edited Jan 1, 1970
zlhxxx176
answered Oct 20, 2025
Related Questions
SelectDB Doris 2.1.8-3:CCR 下游集群 20 台 BE 缩容 1 台时 lag 持续增大,取消缩容后恢复
jetty 安全漏洞CVE-2026-10050
1 answers
通过spark connector写入数据时,doris.fenodes配置了多个节点,但只有第一个节点生效。
1 answers
SelectDB Doris 2.1.8-3 升级使用灵活部分列更新,推荐版本及升级流程咨询
1 answers
Flink Connector 26.3.0 读取 DATETIME 变成 1970 年,切换 25.0.0 后正常
1 answers
Apache Doris Dashboard未授权访问漏洞
1 answers

Terms of service Privacy policy

Powered by Answer - the open-source software that powers Q&A communities.
Made with love © 2026 Apache Doris 中文技术论坛.