Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to perform FULL OUTER JOIN in ORACLE using ' ' operator?
- 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
- select a.field1, b.field2
- from table_a a full outer join table_b b
- on a.id = b.id
- with
- a as
- (select 'A' tbl, level id from dual connect by level < 1000),
- b as
- (select 'B' tbl, level + 500 id from dual connect by level < 1000)
- select a.tbl, a.id, b.tbl, b.id from a, b where a.id = b.id(+)
- union all
- select a.tbl, a.id, b.tbl, b.id from a, b where a.id(+) = b.id and a.id is null
- with
- a as
- (select 'A' tbl, level id from dual connect by level < 1000),
- b as
- (select 'B' tbl, level + 500 id from dual connect by level < 1000)
- select a.tbl, a.id, b.tbl, b.id from a full outer join b on a.id = b.id
Advertisement
Add Comment
Please, Sign In to add comment