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

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

Asked Jul 17, 2024 Modified Jul 18, 2024
Viewed 144
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
黄海军@SelectDB5198
answered Jul 17, 2024

好像不是同个问题

edited Jan 1, 1970
zlhxxx162
answered Oct 20
Related Questions
不同doris集群如何同步数据?
1 answers
bitmap类型设置默认值后,数据导入报错can not cast from origin type bitmap to target type=varchar(65533)
1 answers
doris2.1.8,相同的sql,不同账期但数据量差异,大小表join,有时候会自动join reorder导致OOM
1 answers
Doris BE 集群1-2个节点过一段时间后内存持续升高,出现OOM,定位是冷数据垃圾回收功能影响
1 answers
doris2.1.7 truncate table xxx 及 create table 报错,faied to find enugh backend
1 answers
flinksql写Doris标记删除时'sink.enable-delete' = 'false'的含义
1 answers

Terms of service Privacy policy

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