MysqlJOINS
1、INNER JOIN(内连接)
SELECT<select_list>
FROM Table_A A
INNERJOIN Table_B B
ON A.Key = B.Key
2、LEFT JOIN(左连接)
SELECT<select_list>
FROM Table_A A
LEFTJOIN Table_B B
ON A.Key = B.Key
3、右连接(RIGHT JOIN)
SELECT<select_list>
FROM Table_A A
RIGHTJOIN Table_B B
ON A.Key = B.Key
4、Outer JOIN(全连接)
此Join也可以称为a FULL OUTER JOIN或a FULL JOIN。
SELECT<select_list>
FROM Table_A A
FULLOUTERJOIN Table_B B
ON A.Key = B.Key
5、Left Excluding JOIN(左部分,不包含共同)
SELECT<select_list>
FROM Table_A A
LEFTJOIN Table_B B
ON A.Key = B.Key
WHERE B.KeyISNULL
6、Right Excluding JOIN(右部分,不包含共同)
SELECT<select_list>
FROM Table_A A
RIGHTJOIN Table_B B
ON A.Key = B.Key
WHERE A.KeyISNULL
7、Outer Excluding JOIN(不包含共同)
SELECT<select_list>
FROM Table_A A
FULLOUTERJOIN Table_B B
ON A.Key = B.Key
WHERE A.KeyISNULLOR B.KeyISNULL
网址:https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins
以上是 MysqlJOINS 的全部内容, 来源链接: utcz.com/z/517526.html