当前位置:网站首页>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 .
边栏推荐
- haproxy实现灰度发布
- MYSQL入门与进阶(七)
- Six countries in Europe and the United States launched an express line product to optimize the "end-to-end" performance service on the 5th
- Bubble sorting and Related videos
- haproxy实现代理配置
- Golang 并发之锁
- 明德生物:公司暂未有产品被列入WHO推荐清单
- Performance parameters of spectrum analyzer
- Live broadcast starrocks technology insider: low base global dictionary optimization
- Introduction to CC cable of USB type-C
猜你喜欢

MySQL advanced mvcc (ultra detailed collation)

insight! Baidu pushed redis ceiling notes, which was originally understood by the database

顿悟!百度强推的Redis天花板笔记,原来数据库是这样理解的

Brief introduction to the principle of spectrometer II

USB type-C details

Introduction to the principle of signal source

冒泡排序和相关视频

腾讯汤道生:开源是产业互联网时代新的生产方式和协作模式

1.2、队列

UE5 GAS 学习笔记0.2配置插件
随机推荐
Mongodb initialization operation
Experimental building - PHP Dafa
LVS手册
Introduction to the principle of signal source
Ue5 gas learning notes 8.0 references
When golang encounters high concurrency seckill
不理解模块化、组件化、插件化的区别怎么行?
Detailed explanation of oscilloscope probe
LVS manual
Syntax error: non declaration statement outside function bodygo and syntax error: unexpected {, expect
GIS数据漫谈(六)— 投影坐标系统
What is the employment prospect of software testing?
DC-DC switching power supply
Ue5 gas learning notes 1.9 skill system global classes (abilitysystemglobals)
PyQt5快速开发与实战 5.3 多线程
Is it really realistic that people who have not been exposed to software testing can take up their posts after two months of training?
.net swagger
欧美六国最快5日达 菜鸟推出快线产品 优化“端到端”履约服务
Summer Challenge [FFH] JS custom component: DIY a keyboard that can be used at any time! (I)
GO exe生成图标版本信息