关于SQL的各种连接详情:https://www.cnblogs.com/Swaggy-yyq/p/14267882.html
SQL SERVER:
左连接: select a.* from a, b where a.id *=b.id;
右连接: select a.* from a, b where a.id =* b.id;
总结:* 在哪边,哪边就是主表
ORACLE:
左连接:select * from a,b where a.id = b.id(+);
右连接:select * from a,b where a.id (+)= b.id;
总结:+在哪边,哪边就是附表。 + 表示补充,即哪个表有加号,这个表就是匹配表(附加表)
如果加号写在右表,左表就是主表数据全部显示,所以是左连接。
如果加号写在左表,右表就是主表数据全部显示,所以是右连接。