Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> What kind of Join should i use ?
Hi all
I am really confused with my following problem ...
These are my two tables
SQL> select * from ms1;
PROGRAM RES MS1_VAL
------------ ------------ ---------
Program - A R1 10
SQL> select * from ms2;
PROGRAM LS MS2_VAL
------------ ------------ ---------
Program - B LS02 11 Program - A LS01 12 Program - A LS02 20
now what i want is the following resultant set
Program Res LS MS1_VAL + MS2_VAL
Program - A R1 LS01 21 (10 + 12) Program - A R1 LS02 30 (10 + 20) Program - B R1 LS01 0/NULL (coz Program - B and R1 doesn't exist in ms1 and Program - B and LS01 does not exist in ms2) Program - B R1 LS02 11 (coz Program - B and R1doesn't exist in ms1 whereas Program - B and LS02 does exist in ms2 and its value is 11)
What kind of join should i use so as to achieve the above result ? I have tried a lot of things but nothing works . I am not listing down my stupid queries which i tried
I hope i am clear with the problem !
Regards & Thanks in advance
~Parvinder Received on Mon Dec 27 1999 - 07:20:21 CST
![]() |
![]() |