Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> What kind of Join should i use ?

What kind of Join should i use ?

From: Parvinder Singh <parora_at_questone.com>
Date: Mon, 27 Dec 1999 13:20:21 GMT
Message-ID: <38676781.3448309D@questone.com>


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 R1
doesn'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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US