Hi All,
I've been using three co-related queries to fetch data as shown below in the pseudo code. All these sub-queries are same, except the column name. I want to avoid the same query to be executed thrice for three columns. Is there any way to avoid this?
insert into my_table
select colA,
colB,
(select field1 from table1 where table1.fieldx =tableA.fieldy ) col1,
(select field2 from table1 where table1.fieldx =tableA.fieldy) col2,
(select field3 from table1 where table1.fieldx =tableA.fieldy) col3
from tableA , table B
where con1= con2
and con3 = con4
and con4=con5;
All suggestions are welcomed
Regards,
K