a b c1 d1
a b c1 d2
a b c1 d3
a b c2 d1
a b c2 d2
a b c2 d3
...
..
As these to tables are independent , you may not be able to get your desired result.
If your tables looked like this,
col1 col2
-------------------------------
Table A) a1 c1
a2 c2
a3 c3
a4 c4
Table B) a1 d1
a2 d2
a3 d3
select a.c1,a.c2,a.c3,b.c4
from tab A a, tab B b
where a.col1 = b.col1(+)
Obviously your join is based on: T1.A=T2.A AND T1.B=T2.B
But what about the relation between columns T1.C and T2.D? What condition should force values 'c1' and 'd2' to be in the same output record? Why not 'c1' and 'd2'? Or 'c3' and 'd1'? Or 'c3' and 'd2', Or....
Something is missing.
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Hi , Modic ,
Your understanding is absolutely right . There are no relationship between column c in T1 and column d in T2 ,
can be any sequence . But that's the user requirement :-)
Hi , Kmesser ,
Your idea is good , But it's the last alternative . If possible , I still want to make it done just by SQL . I don't want to write PL/SQL basically .
Bookmarks