Home » SQL & PL/SQL » SQL & PL/SQL » OUTER JOINS
OUTER JOINS [message #224939] Fri, 16 March 2007 01:37 Go to next message
shubhanawale
Messages: 2
Registered: November 2006
Junior Member
I have Three tables A, B, C
I want to have Full outer join on A and B
ANd left outer join on A and C in single query
How can i do this




Thanks
Re: OUTER JOINS [message #224961 is a reply to message #224939] Fri, 16 March 2007 02:51 Go to previous message
dmitry.nikiforov
Messages: 723
Registered: March 2005
Senior Member
This ?

SQL> select * from a;

        ID
----------
         1
         2
         3
         4
         5

SQL> select * from b;

        ID
----------
         3
         4
         5
         6
         7

SQL> select * from c;

        ID
----------
         4
         5
         6
         7
         8

SQL> select a.id "A", b.id "B", c.id "C"
  2  from a full join b on (a.id = b.id) left join c on (a.id = c.id)
  3  order by 1,2,3;

         A          B          C
---------- ---------- ----------
         1
         2
         3          3
         4          4          4
         5          5          5
                    6
                    7

7 rows selected.

Rgds.
Previous Topic: ORA-03001 while using bulk collect
Next Topic: Updating a primaty key and reflecting the changes to foreign keys.
Goto Forum:
  


Current Time: Mon Dec 05 06:58:45 CST 2016

Total time taken to generate the page: 0.09670 seconds