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
Here are a couple of wild guesses:
UPDATE emp SET sal = 1 WHERE rownum <= 1
doesn't work? try this:
UPDATE (SELECT sal FROM emp WHERE rownum <= 1) AS U SET sal = 1
still doesn't work? Try this:
UPDATE (SELECT ROW_NUMBER() OVER() AS rn, sal FROM emp) AS U
SET sal = 1 WHERE rn = 1
That's what I'd try anyway..
Cheers
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 - 08:24:25 CDT