当前位置:网站首页>数据的删除和修改操作(mysql)
数据的删除和修改操作(mysql)
2022-04-23 07:15:00 【variation8】
//删除更新时间为空并且创建时间在5天以前的数据
DELETE FROM eqmt_order WHERE eqmt_order.update_time IS NULL AND DATE(eqmt_order.create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 5 DAY));
//删除时长小于0.2的所有数据
DELETE FROM eqmt_order WHERE eqmt_order.duration<0.2
//删除指定用户的测试数据
DELETE FROM eqmt_order WHERE eqmt_order.uid=71 OR eqmt_order.uid=4 OR eqmt_order.uid=3 OR eqmt_order.uid=2 OR eqmt_order.uid=1
//更新订单使用时长并保留2位小数
UPDATE eqmt_order SET duration = ROUND(TIMESTAMPDIFF(MINUTE,eqmt_order.create_time,eqmt_order.update_time)/60,2)
//关联更新预约表
UPDATE eqmt_equipment,eqmt_reserve SET is_hot=1 WHERE eqmt_equipment.id=eqmt_reserve.equipment_id AND eqmt_reserve.`status`=1
//更新实际订单使用时长并保留2位小数
UPDATE eqmt_order SET duration = ROUND(TIMESTAMPDIFF(MINUTE,eqmt_order.create_time,eqmt_order.reset_time)/60,2)where eqmt_order.reset_time IS NULL
版权声明
本文为[variation8]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_31151123/article/details/123440309
边栏推荐
猜你喜欢

在MATLAB中快速画圆(给出圆心坐标和半径就能直接画的那种)

nn.Module类的讲解

Distributed service governance Nacos
![[appium] encountered the problem of switching the H5 page embedded in the mobile phone during the test](/img/4a/c741ec4f9aa724e150a5ae24d0f9e9.png)
[appium] encountered the problem of switching the H5 page embedded in the mobile phone during the test

Rotation function of leetcode medium problem

Discussion on ES6 tail tune optimization

一款拥有漂亮外表的Typecho简洁主题_Scarfskin 源码下载

The whole house intelligence bet by the giant is driving the "self revolution" of Hisense, Huawei and Xiaomi

几种智能机器人室内定位方法对比

高精度焊接机械臂定位
随机推荐
情境领导者-第七章、解决绩效问题
Face to face summary 2
Positioning and decoration style
华硕笔记本电脑重装系统后不能读取usb,不能上网
[programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP
dmp引擎工作总结(2021,光剑)
[appium] encountered the problem of switching the H5 page embedded in the mobile phone during the test
怎么读书读论文
Online yaml to XML tool
Implementation principle of instanceof
編譯原理題-帶答案
Go语学习笔记 - 异常处理 | 从零开始Go语言
2022.4.11-4.17 AI行业周刊(第93期):AI行业的困局
Weekly leetcode - 06 array topics 7 ~ 739 ~ 50 ~ offer 62 ~ 26 ~ 189 ~ 9
Thinkphp6 + JWT realizes login verification
Jetson Xavier NX (3) bazel mediapipe installation
idea:使用easyYapi插件导出yapi接口
简述存储器的分级策略
ApplicationReadyEvent的使用
sql 使用过的查询语句