- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
join on详解(On detailed connection)
join on详解(On detailed connection)
The use of JOIN in the SQL statement
The connection (join) keyword in the SQL statement is a more commonly used and less easily understood keyword, and the following example gives a simple explanation that I believe will enlighten you.
- build table table1, table2:
Create, table, table1 (ID, int, name, varchar (10))
Create, table, table2 (ID, int, score, int)
Insert into table1 select 1,lee
Insert into table1 select 2,zhang
Insert into table1 select 4,wang
Insert, into, table2, select, 1,90
Insert into table2 select 2100
Insert, into, table2, select, 3,70
Table
,
Table1 table2 | |
,
ID name |id score |
1 Lee |1 90 |
2 Zhang |2 100 |
4 Wang |3 70 |
,
The following are performed in the query analyzer
I. external connections
1. concepts: including left to outer connections, right outer connections or complete external connections
2., left connection: left join or left outer join
(1) the result set that is left outward joins includes all rows of the left table specified in the LEFT OUTER clause, not just the rows that the join column matches. If the left table with a row in the right line, no table, then the associated results set all select list row right table are null (null).
(2) SQL statement
Select * from, table1, left, join, table2, on, table1.id=table2.id
Results - -
ID name ID score
The
1 Lee 190
2 Zhang 2100
4 Wang NULL NULL
The
Note: all clauses that contain table1 return the corresponding field of the null based on the specified condition. The table2 is displayed not in accord
3. right connection: right join or right outer join
(1) the right outer connection is the reverse connection of the left outer connection. All rows of the right table will be returned. If a row in the right table does not have a matching row in the left table, the null value is returned for the left table.
(2) SQL statement
Select * from, table1, right, join, table2, on, table1.id=table2.id
Results - -
ID name ID score
The
1 Lee 190
2 Zhang 2100
NULL NU
您可能关注的文档
- 6120c文件夹详细解析及安装软件问题解决方法(6120c folder detailed analysis and installation of software problem solving methods).doc
- 58句接见客户必用商务句子(In the 58 sentence, the client must use business sentences).doc
- 628-询价采购文件(628- inquiry purchasing documents).doc
- 4s店前台服务顾问标准话术(The service standard operation if the 4S shop).doc
- 60种鲜榨果汁(60 kinds of fresh juice).doc
- 5s管理内容(5S management content).doc
- 65警惕学人(65 alert learners).doc
- 6303设置(6303 settings).doc
- 7.雷电颂(7. Ode to thunder).doc
- 7000 考验单词 二(7000 test the word two).doc
- linux内核裁剪的具体步骤(Linux kernel cutting specific steps).doc
- linux下的web服务器搭建!(Web server built under linux!).doc
- linux内核解读入门(Introduction to Linux kernel understanding).doc
- linux启动添加内核参数简介(Linux starts adding kernel parameter profiles).doc
- linux中ip隧道的分析与建议(Analysis and suggestion of IP tunnel in Linux).doc
- linux启动过程详解(Linux startup process detailed).doc
- linux多点触控协议(Linux multi touch protocol).doc
- linux定时执行命令(The Linux executes the command regularly).doc
- linux工作队列内核实现(Linux work queue Kernel Implementation).doc
- linux教程2.安装linux(Linux tutorial 2. installing Linux).doc
文档评论(0)