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

Home -> Community -> Mailing Lists -> Oracle-L -> Rolling up Sums

Rolling up Sums

From: <bonnergj_at_songs.sce.com>
Date: Tue, 07 Jan 2003 11:25:48 -0800
Message-ID: <F001.00528F19.20030107112548@fatcity.com>

I have some sql(below) that when run gives me Result #1. What I'm trying to do is to have week 1 roll into week 2, and the total from week 2 roll into week 3 and so forth. I've played around with the "rollup" function but I can't get it to come out like Result #2.
Anyone have any ideas or a way I could get the "rollup" function to produce results like #2?

SELECT ROUND(SUM(t1.baseline_budget),0) cc_budget,

                   t2.week_seq
  FROM ipcs.all_cost_view_outage t1,
                ipcs.week_detail t2
 WHERE t2.week_seq = t1.week_seq
       AND t2.week_detail.proj_id = 2108
 GROUP BY t2.description,
                         t2.week_seq;

Result #1

   Budget Week

      100       1
      100       2
      100       3
      100       4

Result #2

   Budget Week

      100       1
      200       2
      300       3
      400       4

Thanks all...........
bonnergj_at_songs.sce.com

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author:
  INET: bonnergj_at_songs.sce.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Jan 07 2003 - 13:25:48 CST

Original text of this message

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