左连接vs右连接在sql中 [英] Left join vs Right join in sql

查看:47
本文介绍了左连接vs右连接在sql中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在有左连接时使用右连接我的意思是如果我需要从左表查看数据我总是把表放在连接的左边那么为什么要引入右连接?

Why to use Right Join when there is Left Join i mean if i need to view data from left table i always place the table on the left of the join then why the right join is introduced?

推荐答案

阅读本文:

SQL连接的可视化表示 [ ^ ]


想想这个例子:

Think of this example:
SELECT  *
FROM    LeftTable
RIGHT JOIN MiddleTable USING SomeID
LEFT JOIN RightTable USING SomeOtherID



It可以使用左联接来完成,但这样更容易理解

所以答案是清晰的。


It could be done using to left joins, but it's easier to understand this way
So the answer is clarity.


你可以检查这个,希望它是关于加入的全部帮助。

差异在MS SQL Server中的各种连接之间 [ ^ ]
You can check this one, wish it would be help full regarding joining.
Differences Between Various Joins in MS SQL Server[^]


这篇关于左连接vs右连接在sql中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆