当前位置:网站首页>Introduction and advanced level of MySQL (10)
Introduction and advanced level of MySQL (10)
2022-07-28 18:43:00 【Xiaoxinai programming】
1、SQL Intersection and difference operation of

sql The result set of the query in can be understood as ⼀ A collection of
MySql The database only ⽀ Union set
union: Merge result set , Meeting ⾃ Dynamic weight removal , Repeat only keep ⼀ individual .ABCDEF
union all : Merge result set , But it will not rule out repetition .ABCCDEF
unionall efficiency ⽐union⾼
Eg: List the schools in Zhengzhou and Luoyang ⽣ Information
List the student information of Zhengzhou and Luoyang
select * FROM studentinfo 3 where city=' luoyang ' or city=' zhengzhou ' 4 -- union Merger premise : Same number of columns , Types can be compatible
select * FROM studentinfo
where city=' luoyang ' 7 union all 8 select * FROM studentinfo 9 where city=' zhengzhou ' 1011 -- Merge of result sets , As long as the number of columns is the same , Types can be merged if they are compatible 1213 select classid,classname from class 14 union all 15 select studentno,studentname from studentinfo
2、 The concept of subquery
⼦ Query is ⼀ Nested in SELECT、INSERT、UPDATE or DELETE Query in statement
The database engine will ⼦ Query is executed as a virtual table ⾏ Query operation .
⼦ Queries can be used as ⼀ Tables , It can also be used as ⼀ It's worth .
⼦ Query execution ⾏ Rely on nested queries . The sequence starts from the innermost layer ,⼀ layer ⼀ Layer outward ⾏, The outer nested query can access the results of the inner nested query , phase ⽐ Variable ⽅ Hold on to ⾏ More efficient ⾼,
⼦ Queries can also combine data from multiple tables into ⼀ rise .
⼦ Inquire about :( Will retrieve —— Single table 、 Multiple tables 、 polymerization 、⼦ Inquire about ) As a result ⼀ Virtual table data participates in the operation of other statements ⾏.
Can exist as a table , It can also exist as a value ⼦ Query is ok ⽤ Association query implementation , however ⼀ Look at it ⼦ Query to ⽐ Relational query ⾼; limitations : Such as ⼦ The query exists as a table ——select Later change can ⽤⼦ Columns to query ; If ⼦ Query as retrieved value set The value of , Can't be in select In the column name position of ⼦ The column name of the query .
边栏推荐
- UE5 GAS 学习笔记 1.8 游戏特效(GameplayCue)
- MYSQL入门与进阶(一)
- Performance parameters of spectrum analyzer
- UE5 GAS 学习笔记0.2配置插件
- leetcode 二叉树类
- LeetCode_343_整数拆分
- UE5 GAS 学习笔记0.1 案例预览
- Mqtt over quic: the next generation Internet of things standard protocol injects new impetus into the message transmission scenario
- Examples of AC simulation and S-parameter simulation of ADS simulation
- DC simulation example of ADS simulation
猜你喜欢

Mqtt over quic: the next generation Internet of things standard protocol injects new impetus into the message transmission scenario

MYSQL入门与进阶(七)

Introduction to advanced design system (ads) 2009 RF simulation

Wired: who owns the art of the future? Openai allows dall-e users to commercialize their works. At present

Multithreading and high concurrency -- source code analysis AQS principle

npm 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。

Noise of creative coding

当Golang遇到高并发秒杀

USB type-C details

WordPress prompt error in establishing database connection
随机推荐
Performance parameters of spectrum analyzer
Iptables firewall port rule configuration
mysql 索引使用与优化
Huawei ZTE lost the lawsuit in the UK and will be banned if it does not pay the patent licensing fee!
有一种密码学专用语言叫做ASN.1
Cout.write learning
What is the employment prospect of software testing?
从 SRE 看 DevOps 建设
MYSQL入门与进阶(一)
Mqtt over quic: the next generation Internet of things standard protocol injects new impetus into the message transmission scenario
Leetcode79 method 1: deep search
Is the training institution of software testing reliable
MQTT over QUIC:下一代物联网标准协议为消息传输场景注入新动力
Ue5 gas learning notes 1.10 prediction
MYSQL入门与进阶(九)
VMware virtual machine networking settings (win10 comes with virtual machine installation win7)
Devops in digital transformation -- flexible cooperation
When golang encounters high concurrency seckill
Ue5 gas learning notes 0.1 case Preview
Iptables configuration