Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

What am I doing wrong in this Update statement

$
0
0
Hi All,

Wonder what I'm doing wrong in this update statement.
The subquery returns the correct no of rows (4085) whereas the whole query when updated returns 3-3.5 times more rows.

update proddta.f1212 set main = 'FDX'
where exists
(select ammin from proddta.f1212
join proddta.f7055 on amdb=cndb
join proddta.f9011 a on a.r6tmt=cntmt
join proddta.f9011 b on b.r6tmt=amtmt
where amtmt < 4500 and a.r6cnt = 'US' and ammin <> 'DHL' and amdb in ('1111', '2222'));

(the am% columns comes from the table F1212)

Thanks in advance for your help to identify.

Viewing all articles
Browse latest Browse all 13329

Trending Articles