当前位置:网站首页>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
边栏推荐
- How is the entered query SQL statement executed?
- Clickhouse synchronization MySQL (based on materialization engine)
- Deflocculant aminoiodotide eye drops
- An elegant program for Euclid‘s algorithm
- Analysis of glibc strlen implementation mode
- [groovy] groovy environment setup (download groovy | install groovy | configure groovy environment variables)
- Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
- This article takes you to understand the relationship between the past and present of Bi and the digital transformation of enterprises
- speed or tempo in classical music
- [vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
猜你喜欢
测试开发是什么?为什么现在那么多公司都要招聘测试开发?
【软件逆向-基础知识】分析方法、汇编指令体系结构
Clickhouse同步mysql(基于物化引擎)
[web source code code code audit method] audit skills and tools
UI automation test farewell to manual download of browser driver
[groovy] groovy environment setup (download groovy | install groovy | configure groovy environment variables)
[an Xun cup 2019] not file upload
grandMA2 onPC 3.1.2.5的DMX参数摸索
How about programmers' eyesight| Daily anecdotes
[groovy] string (string splicing | multi line string)
随机推荐
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
Basic function learning 02
Clickhouse materialized view
汇编-入门
How to define a unified response object gracefully
IronXL for .NET 2022.6
【PHP特性-变量覆盖】函数的使用不当、配置不当、代码逻辑漏洞
MindFusion.Virtual Keyboard for WPF
The new project Galaxy token just announced by coinlist is gal
Difference between MotionEvent. getRawX and MotionEvent. getX
Clickhouse物化视图
MySQL winter vacation self-study 2022 11 (10)
一文带你了解BI的前世今身与企业数字化转型的关系
Subversive cognition: what does SRE do?
As soon as I write the code, President Wang talks with me about the pattern all day
【web源码-代码审计方法】审计技巧及审计工具
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Yuancosmic ecological panorama [2022 latest]
Technology sharing swift defense programming
[untitled]