当前位置:网站首页>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
边栏推荐
猜你喜欢

集合---ArrayList的底层

Transformer

【论文阅读】Further Non-local and Channel Attention Networks for Vehicle Re-identification

MNIST手写数字识别 —— ResNet-经典卷积神经网络

Windows10重置MySQL用户密码

Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience

MNIST Handwritten Digit Recognition - Image Analysis Method for Binary Classification

Copy攻城狮信手”粘“来 AI 对对联

彻底删除MySQL教程

PP-LiteSeg
随机推荐
(导航页)OpenStack-M版-双节点手工搭建-附B站视频
Deep Adversarial Decomposition: A Unified Framework for Separating Superimposed Images
MNIST Handwritten Digit Recognition - From Perceptrons to Convolutional Neural Networks
MFC读取点云,只能正常显示第一个,显示后面时报错
tensorRT5.15 使用中的注意点
counting cycle
YOLOV4流程图(方便理解)
第三章 标准单元库(下)
MNIST手写数字识别 —— 基于Mindspore快速构建感知机实现十分类
Cut the hit pro subtitles export of essays
ConnectionRefusedError: [Errno 111] Connection refused问题解决
亚马逊云科技Build On-Amazon Neptune基于知识图谱的推荐模型构建心得
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
第一章 绪论
【深度学习日记】第一天:Hello world,Hello CNN MNIST
理想的生活
[日常办公][shell]常用代码段
【论文阅读】SPANET: SPATIAL PYRAMID ATTENTION NETWORK FOR ENHANCED IMAGE RECOGNITION
迅雷关闭自动更新
Rules.make-适合在编辑模式下看