SQL UPDATE 'where EXISTS' issue - 2 tables

Associate
Joined
18 Oct 2002
Posts
100
Hi

Wonder if someone can give me some pointers of what's wrong with this update statement

Use MYSQL all the item but SQL is slightly different & just starting although they are similar

Code:
update 
lists
set    
lists.STOCKCODE = (select stock.STOCKCODE
                  from stock
                  where lists.ID = stock.ID)
where EXISTS(select lists.StatusID from lists where lists.StatusID=16)

Statement updates all lists.STOCKCODE with any StatusID can't get it to only update where lists.StatusID=16

Thanks in advance

Regards

Dave
 
Back
Top Bottom