SQL> create table demo1
2 as (
3 select 1 id,'demo1' flag from dual
4 union
5 select 2,'demo1' from dual
6 union
7 select 4,'demo1' from dual
8 );
Table created
SQL>
SQL> create table demo2
2 as
3 (
4 select 1 id,'demo2' flag from dual
5 union
6 select 2,'demo2' from dual
7 union
8 select 5,'demo2' from dual
9 );
Table created
SQL>
SQL> create table demo3
2 as
3 (
4 select 1 id,'demo3' flag from dual
5 union
6 select 3,'demo3' from dual
7 union
8 select 6,'demo3' from dual
9 );
Table created
SQL> select * from demo1;
ID FLAG
---------- -----
1 demo1
2 demo1
4 demo1
SQL> select * from demo2;
ID FLAG
---------- -----
1 demo2
2 demo2
5 demo2
SQL> select * from demo3;
ID FLAG
---------- -----
1 demo3
3 demo3
6 demo3
SQL>
SQL> select * from demo1 full join demo2
2 on demo1.id=demo2.id
3 full join demo3
4 on demo2.id=demo3.id
5 order by demo1.id,demo2.id,demo3.id;
ID FLAG ID FLAG ID FLAG
---------- ----- ---------- ----- ---------- -----
1 demo1 1 demo2 1 demo3
2 demo1 2 demo2
4 demo1
5 demo2
3 demo3
6 demo3
6 rows selected
SQL>