当前位置:网站首页>Multi table operation - external connection query
Multi table operation - external connection query
2022-07-04 19:41:00 【Soup key TJ】
Catalog
- External connection query is divided into left external connection query and right external connection query
- Take a table as Lord , Take out all the records in it , Then each one is joined to another table , Whether or not you can match the conditions , In the end, they will keep
- Can match , Keep it right ; Can't match , The fields of other tables are empty (null), Called external connection
The left outer join
- Query principle
- Query all the data in the left table , And the left and right tables have the intersection part of the data
- The query syntax
- select Name from Table name 1 left [outer] join Table name 2 on Conditions
Right connection
- Query principle
- Query all the data in the right table , And the left and right tables have the intersection part of the data
- The query syntax
- select Name from Table name 1 right [outer] join Table name 2 on Conditions
Example operation
- Please click to view the data preparation of the table
- The left outer join
- Query all user information , And the corresponding order information of the user

-- The left outer join -- Query all user information , And the corresponding order information of the user SELECT u.*, o.number FROM user u LEFT OUTER JOIN orderlist o ON o.uid=u.id;- Right connection
- Query all order information , And the user information of the order

-- Right connection -- Query all order information , And the user information of the order SELECT o.*, u.name FROM user u RIGHT OUTER JOIN orderlist o ON o.uid=u.id;
边栏推荐
- 爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
- Several methods of online database migration
- kotlin 类和对象
- 明明的随机数
- Opencv functions and methods related to binary threshold processing are summarized for comparison and use
- There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
- JVM系列之对象的创建
- Introduction to polyfit software
- Online sql to excel (xls/xlsx) tool
- 1011 World Cup betting (20 points) (pat a)
猜你喜欢

C# 使用StopWatch测量程序运行时间

LM10丨余弦波动顺势网格策略

Oracle with as ora-00903: invalid table name multi report error
Niuke Xiaobai month race 7 who is the divine Archer

【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
牛客小白月赛7 谁是神箭手

如何使用Async-Awati异步任務處理代替BackgroundWorker?

多表操作-内连接查询

YOLOv5s-ShuffleNetV2

西门子HMI下载时提示缺少面板映像解决方案
随机推荐
BCG 使用之CBCGPProgressDlg进度条使用
Online text line fixed length fill tool
Several methods of online database migration
Functional interface
Jetpack Compose 教程
Educational Codeforces Round 22 E. Army Creation
Technologie de base de la programmation Shell IV
Niuke Xiaobai month race 7 e applese's super ability
.NET ORM框架HiSql实战-第二章-使用Hisql实现菜单管理(增删改查)
《工作、消费主义和新穷人》的微信读书笔记
在线文本行固定长度填充工具
1008 elevator (20 points) (PAT class a)
Cbcgpprogressdlgctrl progress bar used by BCG
English语法_名词 - 使用
The kth largest element in the array
The difference and usage between substr (), slice (), and substring () in the string interception methods of "understand series after reading"
JVM系列之对象的创建
多表操作-外连接查询
项目中遇到的线上数据迁移方案1---总体思路整理和技术梳理
Allure of pytest visual test report

