美文网首页
oracle的full join关联的表限制条件在on后面与限制

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

作者: 园溪 | 来源:发表于2021-12-27 10:19 被阅读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;

相关文章

网友评论

      本文标题:oracle的full join关联的表限制条件在on后面与限制

      本文链接:https://www.haomeiwen.com/subject/bzxyqrtx.html