当前位置:网站首页>Delete all data of specified query criteria in Oracle
Delete all data of specified query criteria in Oracle
2022-07-24 00:14:00 【Milk coffee 13】
One 、 Business needs
The business needs to be able to delete all the contents found according to the query .
Two 、 Thought analysis
Oracle Can be deleted directly by DELETE Statements delete the contents of specified conditions one by one ; But this way is too troublesome , If there are tens of millions of items , The effect of implementation is not high , It's not elegant either ; Is there any way to delete all the contents queried according to the conditions without writing a cycle ?
just Oracle Of IN Condition It can meet this effect ,IN It can match all the contents that meet the conditions , Equivalent to traversal loop .
3、 ... and 、 Implementation method
3.1、 Delete all the data of the specified query criteria
DELETE Table name WHERE Field name IN (SELECT Field name FROM Table name WHERE Field name + Expression conditions )3.2、 Implementation steps
① The data in the original table is as follows :

② For example, delete salary less than 6000 All personnel information under SQL sentence
// Delete salary less than 6000 And the following employee information
DELETE "EmployeeInfo" WHERE "Salary" IN (SELECT "Salary" FROM "EmployeeInfo" WHERE "Salary"<=6000)③ Delete salary less than 6000 All personnel information under SQL The personnel information table after the statement is as follows :
边栏推荐
猜你喜欢
C language explanation series -- understanding of functions (2) how to use functions to exchange the values of two integer variables

mysql数据库基础

权重分析——熵权法

Data driven excel reading and writing

NGFW portal authentication experiment

webrtc 1对1 -基本架构与目录

Windows软件:如何安装Mysql5.7并配置环境变量

Xmind用例导入到TAPD的方案(附代码)

Linked list - 206. Reverse linked list (this question is very important)
![[details] radio label, change the default selected background color](/img/cd/f3c35a127ddab87ce9dbbc9cac3f6e.png)
[details] radio label, change the default selected background color
随机推荐
力扣刷题训练之超简单
IT基础英语
Notes on cmake compilation tool
Why do most people think programming is difficult?
Cloud native concept
蓝绿部署、金丝雀发布、A/B测试是什么
[hcip] OSPF experiment under mGRE environment, including multi process bidirectional republication and OSPF special area
Nacos
[opencv] - when the parameter type of cv.threshold() function is a number, what does it mean
Pytest interface automation test framework | control test case execution
深度学习之 9 前馈神经网络2:实现前馈神经网络,模型调优
Idea cannot be switched to Chinese
Pushgateway+prometheus+grafana build Flink real-time monitoring
Problems encountered in pytorch
Realize the function of uploading and downloading files and directories similar to RZ and SZ on the native terminal
ESP8266————AT指令+网络透传
权重分析——CRITIC权重法
Pipeline pipeline project is built by declarative and jenkinsfile under Jenkins
The differences between text and image drawing, data storage, localstorage, sessionstorage, and cookies
Linked list - 707. Design linked list