Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: need some help fast, Please
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