当前位置:网站首页>Get to know MySQL connection query for the first time
Get to know MySQL connection query for the first time
2022-07-05 03:56:00 【parallel】
Classified by function :
Internal connection : Equivalent connection : The result is the intersection of multi table queries
Non equivalent connection
Self join
External connection : The left outer join : Left table is the main table
Right connection : The right table is the main one
Full outer join
Cross connect
sql92 standard : Only internal connections are supported
grammar :
SELECT Query list
FROM surface 1, surface 2...
WHERE Connection condition
AND Connection condition
...
(AND filter )
(GROUP BY Clause
HAVING filter
ORDER BY Clause );
sql99 standard :
grammar :
Internal connection :inner( It can be omitted )
External connection : Left lateral :left (outer)
Right outside :right (outer)
Total external :full (outer)
cross :cross
SELECT Query list
FROM surface 1
Connection type join surface 2
on How to connect
....
(WHERE filter
GROUP BY Clause
HAVING filter
ORDER BY Clause );
Such as :
SELECT COUNT(*)
FROM boy
INNER JOIN girl
ON girl.boy_id = boy.id
WHERE boy.age > 25;
Be careful :
1. The query result of the external connection is all the records in the main table , If you match it from the right of the table , The value of the match , If not, display null
2. The left outer join and the right outer join can achieve the same effect by exchanging the order of the two tables
边栏推荐
- 【web源码-代码审计方法】审计技巧及审计工具
- ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 1)
- An elegant program for Euclid‘s algorithm
- About the recent experience of writing questions
- [untitled]
- UI自动化测试从此告别手动下载浏览器驱动
- ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
- Deep learning - LSTM Foundation
- Enterprise level: spire Office for . NET:Platinum|7.7. x
- 已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
猜你喜欢
laravel8 导出Excle文件
v-if VS v-show 2.0
Basic function learning 02
CTF stegano practice stegano 9
Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
Rust区块琏开发——签名加密与私钥公钥
Use of vscode software
IronXL for .NET 2022.6
Some enterprise interview questions of unity interview
随机推荐
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
C语言课设:影院售票管理系统
On the day 25K joined Tencent, I cried
[groovy] string (string injection function | asBoolean | execute | minus)
反絮凝剂-氨碘肽滴眼液
As soon as I write the code, President Wang talks with me about the pattern all day
Plasticscm enterprise crack
Learning notes of raspberry pie 4B - IO communication (I2C)
NEW:Devart dotConnect ADO. NET
Subversive cognition: what does SRE do?
Solve the problem that sqlyog does not have a schema Designer
Timing manager based on C #
【无标题】
Assembly - getting started
面试汇总:这是一份全面&详细的Android面试指南
Yuancosmic ecological panorama [2022 latest]
[an Xun cup 2019] not file upload
Containerd series - detailed explanation of plugins
线上故障突突突?如何紧急诊断、排查与恢复
Installation of postman and postman interceptor