Re: sqlplus compute sum subtotal

  • From: Barbara Baker <barb.baker@xxxxxxxxx>
  • To: Ron Crisco <ron.crisco@xxxxxxxxxxxx>
  • Date: Wed, 14 Apr 2010 19:08:04 -0600

well, as usual, i was making it too hard.
This works perfectly.  I also liked Michael Moore's solution.
Thanks very much for your help!!
Barb


On Wed, Apr 14, 2010 at 4:12 PM, Ron Crisco <ron.crisco@xxxxxxxxxxxx> wrote:

> If I understand your question, then the problem is not with your report
> formatting, but with your SQL. Does this SQL give the answer you want?
>
> SELECT  ccd.cg_category_group_name,
>
>         sum( f.invoice_amt) "Total Invoice Amt"
>
>  FROM workorder_fact f,  class_category_dim ccd
>
> WHERE
>
>  ccd.CC_CLASS_CAT_SID=f.CLASS_CAT_SID
>
> group by
>
> ccd.cg_category_group_name
>
>
>
>
> Ron Crisco
>
> On Wed, Apr 14, 2010 at 4:54 PM, Barbara Baker <barb.baker@xxxxxxxxx>wrote:
>
>> Oracle 9.2.0.7 on linux
>>
>> I thought this should be simple (and perhaps, indeed, it is), but I’m not
>> getting it.
>>
>>
>>
>> I want a sum of the invoice amount when the category changes.
>>
>> e.g., I don’t want the individual account details;
>>
>> I just want a total for LEGAL, a total for RENTALS, etc.
>>
>>
>>
>> Any help??
>>
>> thanks!  Barb
>>
>>
>>

Other related posts: