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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL*Plus compute on calculated column

Re: SQL*Plus compute on calculated column

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 26 Jun 2001 23:21:44 +0200
Message-ID: <tjhv354ut4vdcb@beta-news.demon.nl>

"hani" <hanton32_at_hotmail.com> wrote in message news:8dc139d4.0106260835.4ece62c8_at_posting.google.com...
> Personal Oracle 7 on win 95
>
> I would like some advice on an alternative method to compute sum. I
> would like to do a compute sum on a calculated column but as I
> understand its not possible.
>
> compute sum label "Total for Feed:" of "FRFT balance" "# Records"
> "WBal" on Feed
> --
> select
> decode
> (frft_ind,
> 'FLMTG','===TRUST===',
> 'BRKDP','===BROKER DEPOSITS===',
> frft_ind) "FEED",
> f.product "PRODUCT #",
> sum(os_balance)/100000 "FRFT BALANCE",
> count(*) "# RECORDS",
> sum(os_balance*tprate)/100000000 "WBAL",
> sum(os_balance*tprate)/100000/sum(os_balance)/100 "RATE"
> --
> from
> frft f,
> frft_xref x,
> curr_product p
> --
> where
> f.frft_seq = x.frft_seq and
> f.product = x.frft_product
> --
> group by
> x.frft_ind,
> f.product
> --
> order by
> frft_ind
> /
>
> I would like to do add "wbal"/"frft balance" to the compute sum above
> ?
>

Just add a second compute statement.

Hth,

Sybrand Bakker, Oracle DBA

> any suggestions ?
Received on Tue Jun 26 2001 - 16:21:44 CDT

Original text of this message

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