I have the following query :
update tab1.abc,
tab1.sbd = (select tab2.abc, tab2.sbd from tab2,tab1 where --some conditions)
where exists(select tab2.abc, tab2.sbd from tab2,tab1 where --some conditions)
Now my task is to optmize this query.
I believe removing the exists clause or combining both the where clauses would help a lot.
But how to do it ?
PS : exists clause is in place because I want the number of rows updated to be zero if the select clause returns zero rows.
JOINthe two tables instead ofEXISTS. Something like the following: