Subject Re: [IBO] sql bug ?
Author Svein Erling Tysvaer
Helen,

>Perhaps this is what you intended to do:
>
>update table1 t1 set t1.col1=
>(select t2a.col2 from table2 t2a where t2a.col2=t1.col2)
>where t1.col2 in (select t2b.col2 from table2 t2b)
>
>This resort (two subselects, one correlated) will be horrendously slow

I'd say that

update table1 t1 set t1.col1=
(select t2a.col2 from table2 t2a where t2a.col2=t1.col2)
where exists( select 1 from table2 t2b where t2b.col2 = t1.col2)

would be far better (read: a lot faster).

Set