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 -> Re: Please help: SELECT with calc

Re: Please help: SELECT with calc

From: Steve Haynes <steve_at_rwx777.demon.co.uk>
Date: 1997/10/31
Message-ID: <cA8ffHAD3eW0EwaK@rwx777.demon.co.uk>#1/1

In article <63balm$4tc_at_examiner.concentric.net>, NNOOR <Nnoor_at_cris.com> writes
>
>I have a few columns in a table (DAY_1, DAY_2...DAY_14). I want to
>sum all of these columns accross all of the records. i.e. what is
>the total of all numbers in all DAY_x fields for a given WHERE
>criteria. It should be pretty simple but I can't figure it out.
>
>I tried following but both gave different and wrong results.
>
>(assuming columns are DAY_1, DAY_2 and DAY_3)
>
>SELECT (DAY_1 + DAY_2 + DAY_3) from xxx.yyy
>where ...
>
>AND
>
>SELECT (((DAY_1) + DAY_2) + DAY_3) from ...
>where ...
>
>
>Thanks very much for your help!!!
>
>Regards,
>Nasir (nnoor_at_cris.com)

This question appears so simple, I wonder if I have misunderstood it. You say you want to get the sum, but then your examples just do selects. Maybe you want
select sum(day1)+sum(day2)+sum(dayN) etc where whatever....
Does that help?
Steve



"The floggings will continue until morale improves."
Received on Fri Oct 31 1997 - 00:00:00 CST

Original text of this message

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