不使用FULL OUTER JOIN或FULL JOIN这样的关键字,如何在'+'运算符的帮助下使用'where'子句执行完全外连接?!
All*_*lan 21
你不能(至少直接).Oracle仅支持使用SQL:1999语法的完全外连接.
你可以通过联合两个外连接来伪造它:
select a.field1, b.field2
from table_a a, table_b b
where a.id = b.id(+)
union all
select a.field1, b.field2
from table_a a, table b b
where a.id(+) = b.id
and a.id is null
Run Code Online (Sandbox Code Playgroud)
使用SQL:1999语法可读性更高:
select a.field1, b.field2
from table_a a full outer join table_b b
on a.id = b.id
Run Code Online (Sandbox Code Playgroud)