Oracle(+)号用法

Oracle(+)号用法

select * from t_A a, t_B b where a.id=b.id(+);

select * from t_A a  left join t_B b on a.id = b.id;

 + 表示补充,即哪个表有加号,这个表就是匹配表。如果加号写在右表,左表就是全部显示,所以是左连接,以上两句SQL,效果一致。

select * from t_A a, t_B b where a.id(+)=b.id;
select * from t_A a  right join t_B b on a.id = b.id;

如果加号写在左表,右表就是全部显示,所以是右连接,以上两句SQL,效果一致。

posted @ 2024-05-06 10:50  每天进步多一点  阅读(160)  评论(0编辑  收藏  举报