Subject | Re: [IBO] sql bug ? |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2002-09-20T14:29:56Z |
Helen,
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
>Perhaps this is what you intended to do:I'd say that
>
>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
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