René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

ANSI outer join

create table table_one (
  col_one number,
  col_two char(1)
);
create table table_two (
  col_one number,
  col_two char(1)
);
insert into table_one values (1, 'a');
insert into table_one values (2, 'b');
insert into table_one values (3, 'c');

insert into table_two values (2, 'B');
insert into table_two values (3, 'C');
insert into table_two values (4, 'D');
select * from 
  table_one t1 left outer join
  table_two t2 on t1.col_one = t2.col_one;
   COL_ONE C    COL_ONE C
---------- - ---------- -
         2 b          2 B
         3 c          3 C
         1 a
select * from 
  table_one t1 right outer join
  table_two t2 on t1.col_one = t2.col_one;
   COL_ONE C    COL_ONE C
---------- - ---------- -
         2 b          2 B
         3 c          3 C
                      4 D
select * from 
  table_one t1 full outer join
  table_two t2 on t1.col_one = t2.col_one;
   COL_ONE C    COL_ONE C
---------- - ---------- -
         2 b          2 B
         3 c          3 C
         1 a
                      4 D

Links