SQL Plus - Compute

About

COMPUTE in combination with the BREAK command, calculates and prints summary lines using various standard computations.

Syntax

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

Summary function

The following summary function are available:

  • SUM : Sum of the values in the column.
  • MINIMUM: Minimum value in the column.
  • MAXIMUM: Maximum value in the column.
  • AVG: Average of the values in the column.
  • STD: Standard deviation of the values in the column.
  • VARIANCE: Variance of the values in the column.
  • count: Number of non-null values in the column.
  • NUMBER: Number of rows in the column.

Example

Grand Total

BREAK ON REPORT
COMPUTE SUM OF "Segment Block" ON REPORT

How to

list all compute definition

Enter COMPUTE with no clauses to list the current COMPUTE definition.


Powered by ComboStrap