Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Limit UPDATE statements to affect only one row
DA Morgan wrote:
> Serge Rielau wrote:
>> And, no, I don't have Oracle installed any more than you have IDS >> installed. At least my contributions are constructive. :-)
UPDATE emp SET sal = 1 WHERE rownum <= 1 => Works!
UPDATE (SELECT sal FROM emp WHERE rownum <= 1) SET sal = 1 => Doesn't work
UPDATE (SELECT ROW_NUMBER() OVER() AS rn, sal FROM emp)
SET sal = 1 WHERE rn = 1
=> Wants ORDER BY in the OVER clause, then decides not to work.
Oh well
Serge
-- Serge Rielau DB2 Solutions Development IBM Toronto Lab IOD Conference http://www.ibm.com/software/data/ondemandbusiness/conf2006/Received on Fri Aug 11 2006 - 12:31:16 CDT