当前位置:网站首页>Usage of MySQL subquery keywords (exists)
Usage of MySQL subquery keywords (exists)
2022-07-07 21:14:00 【1024 questions】
1. all
1.1 Format
1.2 characteristic
1.3 operation
2. any(some)
1.1 Format
1.2 characteristic
1.3 operation
3. in
1.1 Format
1.2 characteristic
1.3 operation
4. exist
1.1 Format
1.2 characteristic
1.3 operation
1.4 explain
1. all1.1 Format
all: Compared with all the values returned by the subquery, it is true Then return to true
all It can be done with =,>=,>,<,<=,<> Use a combination of , Respectively equal to , Greater than or equal to , Greater than , Less than , Less than or equal to , Not all the data in it
Greater than all Indicates that the value in the specified column must be greater than each value in the subquery set , That is, it must be greater than the maximum value of the sub query set ; If it is less than, it is less than the minimum value in the sub query .
1.3 operation

any: Compared with all the values returned by the subquery, it is true Then return to true
any It can be done with =,>=,>,<,<=,<> Use a combination of , Respectively equal to , Greater than or equal to , Greater than , Less than , Less than or equal to , Not equal to any of the data
Greater than any Indicates that the value in the specified column must be greater than any value in the subquery set , The subset to be queried must be greater than the smallest ; Others in the same way
some It can be understood as any Another name for
1.3 operation

in Used to determine the value of a record , Whether in the specified set
stay in Add... Before the keyword not You can reverse the conditions
1.3 operation

The subquery if “ There are data results ”( Return at least one row of data ), Then EXISTS() The result is :true, Outer query execution
The subquery if “ No data results ”( No data returned ), Then EXISTS() The result is :false, The outer query does not execute
EXISTS The following sub query does not return any actual data , Only return true or false , When true is returned where Conditions established
Be careful :EXISTS keyword , Than IN The operation efficiency of keywords is high , therefore , In actual development , Especially when there is a large amount of data , Recommended EXISTS keyword
1.3 operation
When querying an outer query , The outer query is executed row by row , When the first line is executed , Determine whether the subquery is true, by true Then this line of data is found , Then the second line queries ... In reciprocating .
The above is personal experience , I hope I can give you a reference , I also hope you can support the software development network .
边栏推荐
- How does codesonar help UAVs find software defects?
- 程序猿赚的那点钱算个P啊!
- Small guide for rapid formation of manipulator (11): standard nomenclature of coordinate system
- 恶魔奶爸 A0 英文零基础的自我提升路
- 国家正规的股票交易app有哪些?使用安不安全
- 恶魔奶爸 A3阶段 近常速语流初接触
- Helix QAC 2020.2新版静态测试工具,最大限度扩展了标准合规性的覆盖范围
- Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]
- Klocwork 代码静态分析工具
- UVA 12230 – crossing rivers (probability) "suggested collection"
猜你喜欢
Lex & yacc of Pisa proxy SQL parsing
![嵌入式系统真正安全了吗?[ OneSpin如何为开发团队全面解决IC完整性问题 ]](/img/af/61b384b1b6ba46aa1a6011f8a30085.png)
嵌入式系统真正安全了吗?[ OneSpin如何为开发团队全面解决IC完整性问题 ]

Intelligent software analysis platform embold
Klocwork code static analysis tool

Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation

智能软件分析平台Embold

How to meet the dual needs of security and confidentiality of medical devices?

The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization

Details of C language integer and floating-point data storage in memory (including details of original code, inverse code, complement, size end storage, etc.)

95年专注安全这一件事 沃尔沃未来聚焦智能驾驶与电气化领域安全
随机推荐
Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
国家正规的股票交易app有哪些?使用安不安全
[concept of network principle]
H3C s7000/s7500e/10500 series post stack BFD detection configuration method
HOJ 2245 浮游三角胞(数学啊 )
智能交通焕发勃勃生机,未来会呈现哪些巨变?[通俗易懂]
201215-03-19 - cocos2dx memory management - specific explanation "recommended collection"
Small guide for rapid formation of manipulator (11): standard nomenclature of coordinate system
Alibaba cloud award winning experience: how to mount NAS file system through ECS
Validutil, "Rethinking the setting of semi supervised learning on graphs"
智能软件分析平台Embold
Nebula importer data import practice
OneSpin | 解决IC设计中的硬件木马和安全信任问题
How to choose financial products? Novice doesn't know anything
阿洛的烦恼
Guava multithreading, futurecallback thread calls are uneven
论文解读(ValidUtil)《Rethinking the Setting of Semi-supervised Learning on Graphs》
恶魔奶爸 A0 英文零基础的自我提升路
Do you have to make money in the account to open an account? Is the fund safe?
Intelligent software analysis platform embold