oracle的full join关联的表限制条件在on后面与限制

2021-12-27  本文已影响0人  园溪

create table test_a(

id number,

name varchar2(10)

);

create table test_b(

id number,

name varchar2(10)

);

select * from test_a a full join test_b b on a.id=b.id and b.id=3 order by a.id,b.id;

select * from test_a a full join (select * from test_b where id=3) b on a.id=b.id order by a.id,b.id;

如果left join的情况查询的结果数据是一致的:

select * from test_a a left join test_b b on a.id=b.id and b.id=3 order by a.id,b.id;

select * from test_a a left join(select * from test_b where id=3) b on a.id=b.id order by a.id,b.id;

上一篇 下一篇

猜你喜欢

热点阅读