当前位置:网站首页>Advanced learning of MySQL -- basics -- multi table query -- self join
Advanced learning of MySQL -- basics -- multi table query -- self join
2022-07-07 00:34:00 【Magic pig 9898】
grammar :
Self connection can be internal connection or external connection
for example
Query employees , And the name of its leader
select a.name , b.name from emp a , emp b where a.managerid = b.id;
in other words , If an employee doesn't have a leader , This employee will not be found out , Isn't that the inner connection
Another example is
Query all employees , And its subordinate leaders , If the employee has no leader , We need to find out
select a.name , b.name from emp a left outer join emp b on a.managerid = b.id;
边栏推荐
- Typescript incremental compilation
- Sword finger offer 26 Substructure of tree
- Leecode brush question record sword finger offer 56 - ii Number of occurrences of numbers in the array II
- How to judge whether an element in an array contains all attribute values of an object
- System activity monitor ISTAT menus 6.61 (1185) Chinese repair
- The programmer resigned and was sentenced to 10 months for deleting the code. Jingdong came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
- Use Yum or up2date to install the postgresql13.3 database
- Memory optimization of Amazon memorydb for redis and Amazon elasticache for redis
- Huawei mate8 battery price_ Huawei mate8 charges very slowly after replacing the battery
- Leecode brushes questions to record interview questions 17.16 massagist
猜你喜欢
陀螺仪的工作原理
How can computers ensure data security in the quantum era? The United States announced four alternative encryption algorithms
Memory optimization of Amazon memorydb for redis and Amazon elasticache for redis
File and image comparison tool kaleidoscope latest download
Pytest multi process / multi thread execution test case
ldap创建公司组织、人员
37页数字乡村振兴智慧农业整体规划建设方案
37 pages Digital Village revitalization intelligent agriculture Comprehensive Planning and Construction Scheme
St table
DAY SIX
随机推荐
C语言输入/输出流和文件操作【二】
How engineers treat open source -- the heartfelt words of an old engineer
Memory optimization of Amazon memorydb for redis and Amazon elasticache for redis
Jenkins' user credentials plug-in installation
DAY THREE
Use mujoco to simulate Cassie robot
Hero League | King | cross the line of fire BGM AI score competition sharing
Are you ready to automate continuous deployment in ci/cd?
2022/2/10 summary
[CVPR 2022] semi supervised object detection: dense learning based semi supervised object detection
dynamic programming
Three application characteristics of immersive projection in offline display
Quaternion attitude calculation of madgwick
谷歌百度雅虎都是中国公司开发的通用搜索引擎_百度搜索引擎url
Data analysis course notes (V) common statistical methods, data and spelling, index and composite index
Quickly use various versions of PostgreSQL database in docker
File and image comparison tool kaleidoscope latest download
TypeScript中使用类型别名
Liuyongxin report | microbiome data analysis and science communication (7:30 p.m.)
Random类的那些事