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: Larry Urban <lurban_at_richmond.infi.net>
Date: Sat, 27 Mar 1999 09:47:58 -0500
Message-ID: <7dir9s$poj$1@nw003t.infi.net>


Michael

Look at NVL(). With it your SQL would be:

    Update MyTable set num = nvl(num, 0) + 1

hope this helps
larry

Global Infolinks wrote in message <7din13$e2u8_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 Sat Mar 27 1999 - 08:47:58 CST

Original text of this message

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