Re: stupid sqlplus problem: compute both avg and sum

From: DanHW <danhw_at_aol.com>
Date: 27 Aug 2000 15:06:35 GMT
Message-ID: <20000827110635.02963.00000278_at_ng-mg1.aol.com>


>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

[Quoted] [Quoted] [Quoted] 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 Received on Sun Aug 27 2000 - 17:06:35 CEST

Original text of this message