当前位置:网站首页>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
边栏推荐
- 天干地支纪年法中为什么是60年一个轮回,而不是120年
- 线上故障突突突?如何紧急诊断、排查与恢复
- speed or tempo in classical music
- [understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
- Redis6-01nosql database
- [untitled]
- Blue Bridge Cup single chip microcomputer -- PWM pulse width modulation
- What is test development? Why do so many companies hire test developers now?
- Thread Basics
- DMX parameter exploration of grandma2 onpc 3.1.2.5
猜你喜欢

Redis source code analysis: redis cluster

为什么百度、阿里这些大厂宁愿花25K招聘应届生,也不愿涨薪5K留住老员工?

Why do some programmers change careers before they are 30?

阿里云ECS使用cloudfs4oss挂载OSS

我就一写代码的,王总整天和我谈格局...

Thread Basics

Clickhouse materialized view

Subversive cognition: what does SRE do?

Timing manager based on C #

面试汇总:这是一份全面&详细的Android面试指南
随机推荐
The new project Galaxy token just announced by coinlist is gal
Why do some programmers change careers before they are 30?
EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
@The problem of cross database query invalidation caused by transactional annotation
[groovy] string (string splicing | multi line string)
Difference between MotionEvent. getRawX and MotionEvent. getX
UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
Clickhouse物化视图
线上故障突突突?如何紧急诊断、排查与恢复
An elegant program for Euclid‘s algorithm
@Transactional 注解导致跨库查询失效的问题
函数基础学习02
Excuse me, my request is a condition update, but it is blocked in the buffer. In this case, can I only flush the cache every time?
我就一写代码的,王总整天和我谈格局...
It took two nights to get Wu Enda's machine learning course certificate from Stanford University
【软件逆向-基础知识】分析方法、汇编指令体系结构
Deflocculant aminoiodotide eye drops
【web源码-代码审计方法】审计技巧及审计工具
[vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
【web审计-源码泄露】获取源码方法,利用工具