当前位置:网站首页>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
边栏推荐
- LeetCode_22_Apr_4th_Week
- lstm pipeline 过程理解(输入输出)
- [开发杂项][调试]debug into kernel
- 基于asp.net的法律援助平台的设计与实现(附项目链接)
- 打金?工作室?账号被封?游戏灰黑产离我们有多近
- Copy攻城狮的年度之“战”|回顾2020
- 审稿意见回复
- The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
- 第一章 绪论
- No matching function for call to 'RCTBridgeModuleNameForClass'
猜你喜欢
随机推荐
光条提取中的连通域筛除
安装MySQL的详细步骤
Machine Learning - Processing of Text Labels for Classification Problems (Feature Engineering)
【五一专属】阿里云ECS大测评#五一专属|向所有热爱分享的“技术劳动者”致敬#
【深度学习日记】第一天:Hello world,Hello CNN MNIST
PP-LiteSeg
如何成长为高级工程师?
光条中心提取方法总结(一)
Golang环境变量设置(二)--GOMODULE&GOPROXY
sbl_init.asm-适合在编辑模式下看
多层LSTM
MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
理想的生活
MFC读取点云,只能正常显示第一个,显示后面时报错
MNIST手写数字识别 —— 从零构建感知机实现二分类
浅谈外挂常识和如何防御
【论文阅读】Anchor-Free Person Search
深度确定性策略梯度(DDPG)
在AWS-EC2中安装Minikube集群
MNIST手写数字识别 —— ResNet-经典卷积神经网络









