当前位置:网站首页>数据的删除和修改操作(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
边栏推荐
猜你喜欢
Go语学习笔记 - 语言接口 | 从零开始Go语言
一篇文章看懂变量提升(hoisting)
dried food! Point based: differentiable Poisson solver
谈谈那些基础但不简单的股票数据
Ubuntu安装Mysql并查询平均成绩
2022.4.11-4.17 AI industry weekly (issue 93): the dilemma of AI industry
The whole house intelligence bet by the giant is driving the "self revolution" of Hisense, Huawei and Xiaomi
Kubernetes in browser and IDE | interactive learning platform killercoda
clang 如何产生汇编文件
thinkphp6+jwt 实现登录验证
随机推荐
LeetCode简单题之三除数
How does feign integrate hystrix
Go语学习笔记 - 异常处理 | 从零开始Go语言
将实例化对象的方法 给新的对象用
[appium] encountered the problem of switching the H5 page embedded in the mobile phone during the test
C语言学习记录——삼십팔 字符串函数使用和剖析(2)
室内定位技术对比
Canvas learning Chapter 1
Transformer-XL: Attentive Language ModelsBeyond a Fixed-Length Context 论文总结
Mobile terminal layout (3D conversion, animation)
为什么会存在1px问题?怎么解决?
常用正则表达式
2022.4.11-4.17 AI industry weekly (issue 93): the dilemma of AI industry
1216_ MISRA_ C standard learning notes_ Rule requirements for control flow
The whole house intelligence bet by the giant is driving the "self revolution" of Hisense, Huawei and Xiaomi
CSV column extract column extraction
访问数据库的时候出现错误 Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY.详解
Jetson Xavier NX (3) bazel mediapipe installation
总线结构概述
LeetCode簡單題之計算字符串的數字和