当前位置:网站首页>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
边栏推荐
- [groovy] string (string splicing | multi line string)
- 线程基础知识
- CTF stegano practice stegano 9
- Clickhouse synchronization MySQL (based on materialization engine)
- An elegant program for Euclid‘s algorithm
- [groovy] string (string type variable definition | character type variable definition)
- @The problem of cross database query invalidation caused by transactional annotation
- Difference between MotionEvent. getRawX and MotionEvent. getX
- 特殊版:SpreadJS v15.1 VS SpreadJS v15.0
- [groovy] loop control (number injection function implements loop | times function | upto function | downto function | step function | closure can be written outside as the final parameter)
猜你喜欢
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
【软件逆向-分析工具】反汇编和反编译工具
Zero foundation uses paddlepaddle to build lenet-5 network
[groovy] string (string type variable definition | character type variable definition)
Clickhouse synchronization MySQL (based on materialization engine)
IronXL for .NET 2022.6
MindFusion. Virtual Keyboard for WPF
Smart pointer shared_ PTR and weak_ Difference of PTR
KVM virtualization
[software reverse - basic knowledge] analysis method, assembly instruction architecture
随机推荐
Special Edition: spreadjs v15.1 vs spreadjs v15.0
面试汇总:这是一份全面&详细的Android面试指南
Official announcement! The third cloud native programming challenge is officially launched!
How rem is used
【做题打卡】集成每日5题分享(第三期)
NPM introduction link symbolic link
An elegant program for Euclid‘s algorithm
Clickhouse同步mysql(基于物化引擎)
[an Xun cup 2019] not file upload
线上故障突突突?如何紧急诊断、排查与恢复
输入的查询SQL语句,是如何执行的?
[software reverse analysis tool] disassembly and decompilation tool
为什么百度、阿里这些大厂宁愿花25K招聘应届生,也不愿涨薪5K留住老员工?
[brush questions] BFS topic selection
【看完就懂系列】一文6000字教你从0到1实现接口自动化
Blue Bridge Cup single chip microcomputer -- PWM pulse width modulation
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
【web源码-代码审计方法】审计技巧及审计工具
About authentication services (front and back, login, registration and exit, permission management)
Redis source code analysis: redis cluster