db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Army <qoz...@sbcglobal.net>
Subject Re: using a join in an UPDATE command
Date Fri, 04 Mar 2005 17:14:23 GMT
Army wrote:

> 
> The following is perhaps a tad ugly (and performance might be 
> unacceptable), but I think this does what you want...?
> 
> update keys set ky = (select locked_key from badies where 
> keys.person=badies.person) where 0 != (select count(*) from badies where 
> keys.person=badies.person);
> 

Slightly less messy, slightly better peformance (removes a join):

update keys set ky = (select locked_key from badies where keys.person=badies.person) where
keys.person in (select person 
from badies);


Mime
View raw message