Subject Re: [firebird-support] Re: Update query using multiple tables
Author Rich Pinder
Thanks so much for pointing this out Svein.
For this situation, no harm in the other. But for the future.... a
very important point.

Rich

Svein Erling Tysvaer wrote:
>
>
> Right, but that query also updates all rows that are not in richselect
> at all, setting their ccssid to NULL. Often, the desired select is
> something like:
>
> update regtmp rt
> set rt.ccssid =
> (
> select rs.ccssid
> from richselect rs
> where rs.uscid = rt.uscid
> )
> where exists(select *
> from richselect rs2
> where rs2.uscid = rt.uscid)
>
> (the difference between these two queries would be visible if regtmp had
> a value for ccssid for uscid 002 before the update)
>
> Set
>
> ,_._,___