Re: Compute By SQL Statement

From: Eric from Speco <eric_at_speco.com>
Date: Fri, 6 Jul 2001 12:55:00 -0500
Message-ID: <9i4u3j$h2j$1_at_bob.news.rcn.net>


There's no COMPUTE BY Statement that I know of. Oracle will compute a function (Avg., Sum, Max etc) of a column specified in a BREAK command and/or a SELECT Statement.

The syntax is:
COMP[UTE] [function [LAB[EL] text] ... OF {expr|column|alias} ... ON {expr|column|alias|REPORT|ROW} ...]

Here's an example of a subtotal, grand total report:

BREAK ON t$orno SKIP 1 ON REPORT
COMPUTE SUM LABEL Subtotal OF t$pric ON t$orno COMPUTE SUM LABEL Total OF t$pric ON REPORT COLUMN t$pric FORMAT $99,990.00

SELECT t$orno, t$pric
  FROM my_table;

webdad3 <jeff_vaccaro_at_hotmail.com> wrote in message news:759da686.0107051332.34dd1a92_at_posting.google.com...
> I was looking at a query in SQL Server 7, and it had the Compute By
> statement. Basically, it sums to a grand total.
>
> My question is, is that command valid in Oracle?
>
> Thanks,
>
> Jeff
> www.parentsdb.com
Received on Fri Jul 06 2001 - 19:55:00 CEST

Original text of this message