当前位置:网站首页>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
边栏推荐
- 【Copy攻城狮日志】飞浆学院强化学习7日打卡营-学习笔记
- Comparison of oracle's number and postgresql's numeric
- 度量学习(Metric learning)—— 基于分类损失函数(softmax、交叉熵、cosface、arcface)
- 浅谈游戏音效测试点
- arm-3-中断体系结构
- 【论文阅读】Multi-View Spectral Clustering with Optimal Neighborhood Laplacian Matrix
- 周志华机器学习
- CAS无锁队列的实现
- A code example of the PCL method in the domain of DG (Domain Generalization)
- Pytest common plug-in
猜你喜欢

Windows10重置MySQL用户密码

CSDN大礼包--高校圆桌派大礼包

tensorRT教程——tensor RT OP理解(实现自定义层,搭建网络)

"A minute" Copy siege lion log 】 【 run MindSpore LeNet model

【论文阅读】Exploring Spatial Significance via Hybrid Pyramidal Graph Network for Vehicle Re-identificatio

arm-2-基础阶段

在AWS-EC2中安装Minikube集群

arm交叉编译

迅雷关闭自动更新

MNIST手写数字识别 —— 图像分析法实现二分类
随机推荐
数据库的简述与常用操作指南
Deep Adversarial Decomposition: A Unified Framework for Separating Superimposed Images
如何用Pygame制作简单的贪吃蛇游戏
【论文阅读】Further Non-local and Channel Attention Networks for Vehicle Re-identification
[日常办公][shell]常用代码段
第二章 STA相关概念
【Copy攻城狮日志】“一分钟”跑通MindSpore的LeNet模型
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
MFC 打开与保存点云PCD文件
tensorRT教程——tensor RT OP理解(实现自定义层,搭建网络)
双向LSTM
MNIST手写数字识别 —— 图像分析法实现二分类
MNIST手写数字识别 —— 从二分类到十分类
第三章 标准单元库(下)
(导航页)OpenStack-M版-双节点手工搭建-附B站视频
打金?工作室?账号被封?游戏灰黑产离我们有多近
No matching function for call to ‘RCTBridgeModuleNameForClass‘
[日常办公][杂项][vscode]tab space
安装pyspider后运行pyspider all后遇到的问题
Copy攻城狮的年度之“战”|回顾2020