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: need some help fast, Please

Re: need some help fast, Please

From: Anne Crowther <anne.crowther_at_nospam.capgemini.co.uk>
Date: Thu, 28 Oct 1999 15:42:10 +0100
Message-ID: <7v9nc6$7p4$1@taliesin.netcom.net.uk>


Joe,

Do you just want to add them together?

If so,

select sv.name, sv.key_STORE_seqID, rv.amount + rv.freight TotalCost from
report_stores_view sv, REPORT_TRANSACTION_VIEW rv where rv.TRANSACTION_DATE >= 936158400 and rv.TRANSACTION_DATE <= 938664000 and transaction_type = '1'
and sv.key_STORE_seqID = '500080'

will do.

Otherwise, use the SUM function:

select sv.name, sv.key_STORE_seqID, SUM(rv.amount) Total_Amount, SUM(rv.freight) Total_Shipping
from
report_stores_view sv, REPORT_TRANSACTION_VIEW rv where rv.TRANSACTION_DATE >= 936158400 and rv.TRANSACTION_DATE <= 938664000 and transaction_type = '1'
and sv.key_STORE_seqID = '500080'
GROUP BY sv.name, sv.key_store_seqid
;

A Crowther

Joe D <joed_at_icoms.com> wrote in message news:38185d37_at_News.Destek.net...
> I have this query:
>
> select sv.name, sv.key_STORE_seqID, rv.amount Amount, rv.freight
Shipping
> from
> report_stores_view sv, REPORT_TRANSACTION_VIEW rv
> where rv.TRANSACTION_DATE >= 936158400 and rv.TRANSACTION_DATE <=
938664000
> and transaction_type = '1'
> and sv.key_STORE_seqID = '500080'
> ;
>
> (I know I have mixed case here but that's not my problem)
>
> What I need to do is to 'sum' the two rv.amount & rv.freight fields. But,
I
> can't get the syntax right. Can anyone help me please?
>
> TIA
>
> Joe
>
>
Received on Thu Oct 28 1999 - 09:42:10 CDT

Original text of this message

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