Hannu Krosing <hannu(at)tm(dot)ee> writes:
> the more accurate (nonstandard) syntax could have been
>
> SELECT src.val,
> tgt.val
> FROM updatesrc as src FOR UPDATE,
> updatetgd as tgt
> WHERE src.id = tgt.id
> SET src.val = tgt.val
> ;
The syntax in Oracle, for example, would be not very different:
UPDATE (
SELECT src.id, src.val, tgt.val as newval
FROM udpatesrc AS src,
updatetgd AS tgt
WHERE src.id = tgt.id
)
SET val = newval
This only works if src.id is declared as a primary key.
I'm not sure if this is blessed by any standard.
It's certainly extremely useful.
--
greg