hi everyone
i am trying to join three tables(2 same tables and one different table) and it is taking very long time
here is the query
can anyone optimize the query as it is taking very long time to run
i have 2 tables
tablea
tableb
select * from tablea a1 inner join (select * from tableb where condition) a3
on a1.col1=(select max(col1) from tablea a2
where a3.col2=a2.col2)
i am running this same query based on a condition with col2 and it is working fine and i was using only tables a1 and a3 once.
any suggestions welcome
thanks