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 -> Problem with SQL Sum across multiple tables

Problem with SQL Sum across multiple tables

From: <ltho_at_my-dejanews.com>
Date: Tue, 04 Aug 1998 21:41:16 GMT
Message-ID: <6q7v5s$4kh$1@nnrp1.dejanews.com>


Here is the problem I encountered. Your help is appreciated

I have a 3 tables:

NaturalAccount                  Glfact                Fact
---------------                 ------                ----
naturalaccountid                Glfactid              Glfactid
                                Naturalaccountid      AAmount

For each naturalaccountid, there could be multiple glfactid in Glfact table. I want to create a query statement where for each naturalaccountid, I get the sum of all its aamount. The resulting query should look like this

NaturalAccountID1    20.00
NaturalAccountID2    40.00
NaturalAccountID3    99.00

where 20.00, 40.00, 99.00 are each the summation of all the GLfactid under that particular naturalaccountid

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Tue Aug 04 1998 - 16:41:16 CDT

Original text of this message

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