Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Sql Update query syntax to increment a column containing nulls
Try
UPDATE mytable
set num = nvl(num,0) + 1;
Mark
Global Infolinks wrote in message <7dg1ch$7b88_at_iccu9.ipswich.gil.com.au>...
>I want to increment a column in a table. The column may be initially null.
>The following syntax doesnt work, because any arithmetic operation on null
>yields null :
> UPDATE MyTable SET Num = Num + 1;
>
>Is there a "Null to zero" function in Oracle Sql syntax.
>
>Thanks,
>Michael
>
>
Received on Fri Mar 26 1999 - 07:42:22 CST
![]() |
![]() |