当前位置:网站首页>Data deletion and modification (MySQL)
Data deletion and modification (MySQL)
2022-04-23 08:19:00 【variation8】
// The deletion update time is empty and the creation time is 5 Data from days ago
DELETE FROM eqmt_order WHERE eqmt_order.update_time IS NULL AND DATE(eqmt_order.create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 5 DAY));
// Deletion duration is less than 0.2 All data for
DELETE FROM eqmt_order WHERE eqmt_order.duration<0.2
// Delete the test data of the specified user
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
// Update order usage duration and keep 2 Decimal place
UPDATE eqmt_order SET duration = ROUND(TIMESTAMPDIFF(MINUTE,eqmt_order.create_time,eqmt_order.update_time)/60,2)
// Update the reservation table by association
UPDATE eqmt_equipment,eqmt_reserve SET is_hot=1 WHERE eqmt_equipment.id=eqmt_reserve.equipment_id AND eqmt_reserve.`status`=1
// Update the actual order usage time and keep it 2 Decimal place
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://yzsam.com/2022/04/202204230715028754.html
边栏推荐
- LeetCode簡單題之計算字符串的數字和
- [effective go Chinese translation] function
- 搜一下导航完整程序源码
- 干货!以点为形:可微分的泊松求解器
- Briefly describe the hierarchical strategy of memory
- Online app resource download website source code
- AAAI 2022招募讲者啦!!
- 3C装配中的机械臂运动规划
- LeetCode15. Sum of three
- Kubernetes in browser and IDE | interactive learning platform killercoda
猜你喜欢
CSV column extract column extraction
vslam PPT
搜一下导航完整程序源码
一篇文章看懂变量提升(hoisting)
My heart's broken! A woman's circle of friends envied others for paying wages on time and was fired. Even her colleagues who liked her were fired together
The third divisor of leetcode simple question
监控智能回放是什么,如何使用智能回放查询录像
干货!以点为形:可微分的泊松求解器
Discussion on ES6 tail tune optimization
2022.4.11-4.17 AI industry weekly (issue 93): the dilemma of AI industry
随机推荐
常用正则表达式
thinkphp6+jwt 实现登录验证
校园转转二手市场源码下载
Manipulator motion planning in 3C assembly
【Appium】测试时遇到手机内嵌H5页面的切换问题
npm安装yarn
Flatten arrays
How to import Excel data in SQL server, 2019 Edition
扎心了!一女子发朋友圈羡慕别人按时发工资被开除,连点赞的同事也一同被开除了...
PHP high precision computing
ApplicationReadyEvent的使用
Listed on the Shenzhen Stock Exchange: the market value is 5.2 billion yuan. Lu is the East and his daughter is American
Online yaml to XML tool
php高精度计算
Common regular expressions
396. Rotate Function
Ubuntu安装Mysql并查询平均成绩
剑指offer day24 数学(中等)
php生成短链接:将数字转成字母,将字母转成数字
Samsung, March to the west again