其他分享
首页 > 其他分享> > JOIN(7种JOIN)

JOIN(7种JOIN)

作者:互联网

JOIN(7种JOIN)

SELECT FROM TBL1 INNER JOIN TBL2 ON TBL1.KEY = TBL2.KEY

SELECT FROM TBL1 LEFT JOIN TBL2 ON TBL1.KEY = TBL2.KEY

SELECT FROM TBL1 JOIN TBL2 ON TBL1.KEY = TBL2.KEY WHERE TBL2.KEY IS NULL

SELECT FROM TBL1 RIGHT JOIN TBL2 ON TBL1.KEY = TBL2.KEY

SELECT FROM TBL1 RIGHT JOIN TBL2 ON TBL1.KEY =TBL2.KEY WHERE TBL1.KEY IS NULL

SELECT FROM TBL1 FULL OUTER JOIN TBL2 ON TBL1.KEY = TBL2.KEY

SELECT FROM TBL1 FULL OUTER JOIN TBL2 ON TBL1.KEY = TBL2.KEY WHERE TBL1.KEY IS NULL AND TBL2.KEY IS NULL;

标签:FULL,JOIN,TBL2,KEY,TBL1,SELECT
来源: https://www.cnblogs.com/new228666/p/16463661.html