Subject Update a table with IN or EXISTS
Author prom_prometheus
Hi,
(using Firebird 1.5.3 on WindowsXP)

if i try this update:
update tl_neu_ku
set pnr_id = 38, p_nr = 'USER23'
where ku_nr in (select u.ku_nr from tl_neu_ku u, tl_neu_dat d where
d.ku_nr = u.ku_nr and d.bezirksnr = '128034')

it takes 8 minutes and more.

I also tried to use EXISTS:

update tl_neu_ku u
set pnr_id = 38, p_nr = 'USER23'
where exists (select 1 from tl_neu_dat d where u.ku_nr = d.ku_nr and
d.bezirksnr = '128034')
Result:
then i update all the data in table tl_neu_ku (7.000 records) instead
of 167 records, mhm

best regards
Gerhard