当前位置:网站首页>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 .
边栏推荐
- Zen project management software is an indispensable tool for agile development teams
- Go语言系列之日志库zap
- Random talk on GIS data (VI) - projection coordinate system
- UE5 GAS 学习笔记 1.6 技能Gameplay Ability
- 1.2、队列
- 连线:谁拥有未来的艺术?OpenAI允许Dall-E用户将作品商用化,目前而言
- 明德生物:公司暂未有产品被列入WHO推荐清单
- Ue5 gas learning notes 0.1 case Preview
- Log base zap of go language series
- 2022.7.26 构造函数,面试:new的作用、深拷贝和浅拷贝
猜你喜欢

MySQL advanced mvcc (ultra detailed collation)

MySQL index usage and optimization

多线程与高并发—— 源码解析 AQS 原理

Detailed explanation of oscilloscope parameters

当Golang遇到高并发秒杀

Apple develops a complete creation process of Apple certificate and description file

MYSQL入门与进阶(一)

.net WCF WF4.5 状态机、书签与持久化

USB type-C details

When golang encounters high concurrency seckill
随机推荐
UE5 GAS 学习笔记0.2配置插件
Summary of core knowledge points of Computer Composition Principles & key points of written interview [easy to understand]
Iptables firewall port rule configuration
LVS手册
Golang is packaged and released to various platforms
Ue5 gas learning notes 8.0 references
Docker builds MySQL master-slave replication
Golang concurrent lock
Ue5 gas learning notes 1.9 skill system global classes (abilitysystemglobals)
It is said that software testing is the worst in the IT industry. Is that so?
Go并发详解之一
腾讯汤道生:开源是产业互联网时代新的生产方式和协作模式
多线程与高并发—— 源码解析 AQS 原理
Gaode map realizes customized small blue dots, customized point markers, drawing polygon / circular areas, and displaying or hiding customized point markers according to the movement of the map
LeetCode_343_整数拆分
明德生物:公司暂未有产品被列入WHO推荐清单
GO exe生成图标版本信息
Apple develops a complete creation process of Apple certificate and description file
The required error of solidity is reported
Ue5 gas learning notes 1.3 attribute