Hi all,
I have a query where i have to use a Self join on a table
i want to avoid it as it is taking time.
My data is :
Table 1
Column1 column2 column3
x y z
A B C
Table 2
Column1 Column2 Column3 column4
1 2 3 A
4 5 6 A
7 8 9 A
10 11 12 B
Now my requiremntis to get value 3, 6, 9 from table2 in a single query
along with value A , B , c means one row from table1 but 3 rows from
from table2.
I wrote query
Select A.column1, A.column2 , A.column3 , B.column3 ,
C.column3 , d.column4
from Table1 A ,
Table2 B ,
Table2 C ,
Table2 D
where A.column1 = B.column4
AND B.column1 = C.column1
AND B.Column1 = D.column1
AND B.column3 = 3
AND C.column3 = 6
AND D.column3 = 9
Please assist.
Rawat
I have a query where i have to use a Self join on a table
i want to avoid it as it is taking time.
My data is :
Table 1
Column1 column2 column3
x y z
A B C
Table 2
Column1 Column2 Column3 column4
1 2 3 A
4 5 6 A
7 8 9 A
10 11 12 B
Now my requiremntis to get value 3, 6, 9 from table2 in a single query
along with value A , B , c means one row from table1 but 3 rows from
from table2.
I wrote query
Select A.column1, A.column2 , A.column3 , B.column3 ,
C.column3 , d.column4
from Table1 A ,
Table2 B ,
Table2 C ,
Table2 D
where A.column1 = B.column4
AND B.column1 = C.column1
AND B.Column1 = D.column1
AND B.column3 = 3
AND C.column3 = 6
AND D.column3 = 9
Please assist.
Rawat