I have 2 different tables which look something like the following:
--------Table 1---------------------------------------------------------
Cat1 Cat2 Cat3 Value1
a d1 13
b e1 13
a e2 d1 13
c d2 13
a e1 13
a d1 13
--------Table 2 -------------------------------------------------
Cat1 Cat2 Cat3 Value2
a e2 d1 113
c d2 132
a d1 134
a d1 131
b e1 113
a e1 133
The Cat1 and Cat2 for above tables are same but might not be in same order. I want to combined both tables above so that desired table looks like following:
--------Desired Table---------------------------------------------------------
Cat1 Cat2 Cat3 Value1 Value2
a d1 13 134
b e1 13 113
a e2 d1 13 113
c d2 13 132
a e1 13 113
a d1 13 134
I am using apparently an older version of sybase.
Thanks!!
Just try this one (from my ANSI SQL experience):