当前位置:网站首页>MySQL批量修改时间字段
MySQL批量修改时间字段
2022-08-04 05:31:00 【Louzen】
sql批量修改datetime类型的日期,不修改时间
update capturerecord set qtime=date_add(qtime,interval+1 day)
(把所有日期加一天,如:2018-08-24 11:28:59改为2018-08-25 11:28:59)
update 表名 set 时间字段=date_add(时间字段,interval+加减的天数 day)
sql批量修改时间戳,不修改时间,通过datetime类型的时间字段修改int类型的时间戳
(有datetime字段)
update capturerecord set time=unix_timestamp(qtime);
update 表名 set 时间戳字段=unix_timestamp(datetime类型字段);
SELECT FROM_UNIXTIME(capturetime, ‘%Y-%m-%d %H:%i:%S’),capturetime from platerecord
sql批量修改时间戳,不修改时间
(无datetime字段,先添加datetime字段,再通过时间戳字段修改该字段的时间)
update platerecord set time=FROM_UNIXTIME(capturetime, ‘%Y-%m-%d %H:%i:%S’);
update 表名 set datetime字段=FROM_UNIXTIME(时间戳字段, ‘%Y-%m-%d %H:%i:%S’);
time(int时间戳)qtime(datetime时间)
update capturerecord set qtime=date_add(qtime,interval-2 day)
update capturerecord set time=unix_timestamp(qtime);
capturetime(int时间戳)time(datetime时间)
SELECT FROM_UNIXTIME(capturetime, ‘%Y-%m-%d %H:%i:%S’),capturetime from platerecord
update platerecord set time=FROM_UNIXTIME(capturetime, ‘%Y-%m-%d %H:%i:%S’);
update platerecord set time=date_add(time,interval+1 day);
update platerecord set capturetime=unix_timestamp(time);
————————————————
版权声明:本文为CSDN博主「gungun_程序媛」的原创文章
原文链接:https://blog.csdn.net/weixin_43052839/article/details/82015208
边栏推荐
- 基于BiGRU和GAN的数据生成方法
- 度量学习(Metric learning)—— 基于分类损失函数(softmax、交叉熵、cosface、arcface)
- Install Minikube Cluster in AWS-EC2
- PostgreSQL schema (Schema)
- 中国联通、欧莱雅和钉钉都在争相打造的秘密武器?虚拟IP未来还有怎样的可能
- 周志华机器学习
- Copy攻城狮5分钟在线体验 MindIR 格式模型生成
- arm学习-1-开发板
- yoloV5 使用——训练速度慢,加速训练
- Deep Learning Theory - Initialization, Parameter Adjustment
猜你喜欢

【论文阅读】Anchor-Free Person Search

lstm pipeline 过程理解(输入输出)

亚马逊云科技 Build On 2022 - AIot 第二季物联网专场实验心得

LeetCode_Nov_5th_Week

MNIST手写数字识别 —— Lenet-5首个商用级别卷积神经网络

No matching function for call to 'RCTBridgeModuleNameForClass'

PP-LiteSeg

【五一专属】阿里云ECS大测评#五一专属|向所有热爱分享的“技术劳动者”致敬#
![[Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes](/img/af/05caea638de8d75f6d3b42b3d8e28f.png)
[Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes

浅谈外挂常识和如何防御
随机推荐
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
YOLOV4流程图(方便理解)
IEEE802.X协议族
Endnote编辑参考文献
机器学习——分类问题对于文字标签的处理(特征工程)
bind()系统调用的用处
深度学习理论——过拟合、欠拟合、正则化、优化器
【论文阅读】SPANET: SPATIAL PYRAMID ATTENTION NETWORK FOR ENHANCED IMAGE RECOGNITION
安装MySQL的详细步骤
MFC 打开与保存点云PCD文件
Copy Siege Lion's Annual "Battle" | Review 2020
第三章 标准单元库(下)
[开发杂项][编辑器][代码阅读]ctags&vim
PostgreSQL schema (Schema)
target has libraries with conflicting names: libcrypto.a and libssl.a.
No matching function for call to ‘RCTBridgeModuleNameForClass‘
yoloV5 使用——训练速度慢,加速训练
tensorRT教程——tensor RT OP理解(实现自定义层,搭建网络)
Deep Adversarial Decomposition: A Unified Framework for Separating Superimposed Images
Pytest常用插件