Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Sql Update query syntax to increment a column containing nulls

Re: Sql Update query syntax to increment a column containing nulls

From: Mark Gumbs <mgumbs_at_hotmail.com>
Date: Fri, 26 Mar 1999 13:42:22 -0000
Message-ID: <36fb8e00.0@145.227.194.253>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US