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

Home -> Community -> Usenet -> c.d.o.server -> newbie-SQL Count

newbie-SQL Count

From: <shall_at_uaex.edu>
Date: 26 Mar 2007 14:53:05 -0700
Message-ID: <1174945985.126758.235310@p15g2000hsd.googlegroups.com>


I have a table, there are more columns than this. I used this to keep it simple.

ColA    ColB       Quantity
   30       24               2
   30        0                1

I want to do

UPDATE myTable SET Quantity= (SUM(Decode(ColA,NULL,0,0,0,1) +Decode(ColB,NULL,0,0,0,1) )

I get an error message of :
group function is not allowed here

How can I count each Column that has a POSITIVE number and put the sum in QUANTITY?

TIA
Steve Received on Mon Mar 26 2007 - 16:53:05 CDT

Original text of this message

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