Re: stupid sqlplus problem: compute both avg and sum

From: <billmil_at_my-deja.com>
Date: Tue, 29 Aug 2000 19:59:25 GMT
Message-ID: <8oh4mf$2um$1_at_nnrp1.deja.com>


Frank,

Are you sure this works?:
> compute sum of nbr_logins avg of nbr_logins on report

I tried using your syntax above; sqlplus didn't perform either the summary or average functions.

bill

In article <8og3ob$amc$1_at_porthos.nl.uu.net>,   "Frank van Bortel" <f.van.bortel_at_vnl.nl> wrote:
>
> --
> Kind Regards,
> Frank
> <billmil_at_my-deja.com> wrote in message news:8oe1g8$dc6
 $1_at_nnrp1.deja.com...
> > Dan,
> >
> > Thanks for the suggestion. It makes sense, but unfortunately I
 haven't
> > gotten it or a variant to work.
> > > compute sum nbr_logins on report avg nbr_logins on report
> >
> > Also, per your comment on the exact syntax, the syntax of COMPUTE,
 from
> > the SQLPlus reference, doesn't mention any "loop"--i.e. the ability
 to
> > specify more function:
> >
> > COMP[UTE] [function LAB[EL] text ]
> > of {expr|column|alias}
> > on {expr|column|alias|REPORT|ROW}
> >
> > any other suggestions?
> >
> > bill milbratz
> >
> > In article <20000827110635.02963.00000278_at_ng-mg1.aol.com>,
> > danhw_at_aol.com (DanHW) wrote:
> > > >How can I compute, using SQLPLUS, both the *sum* and the
 *average*
 of a
> > > >column?
> > > >
> > > >This seems like pretty basic functionality, but I found:
> > > >1) I couldn't get both sums and averages to work on a column
> > > >2) the sqlplus manual says "if multiple COMPUTE commands
 reference
 the
> > > >same column in the ON clause, only the last COMPUTE command
 applies."
> > > >
> > > >For the record, I tried:
> > > > compute sum label Total of nbr_logins on report
> > > > compute avg label Avg of nbr_logins avg_min_on_site
> > > >total_min_on_site on report
> > > >
> > > >SQLPLUS would average the "nbr_logins" field, but not summarize
 it.
> > > >
> > > >How can I get past this limitation?
> > > >
> > > >thanks,
> > > >
> > > >bill milbratz
> > > >chicago IL usa
> > > >
> > > Only the last STATEMENT is applied, but the stament can have
 multiple
> > > commands. Try
> > >
> > > compute sum nbr_logins on report avg nbr_logins on report
> > >
> > > (you will need to look it up for the precise format)
> > >
> > > HTH
> > > Dan Hekimian-Williams
> > >
> > >
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Aug 29 2000 - 21:59:25 CEST

Original text of this message