SQL Plus - Compute

> Procedural Languages > (SQL Plus|SqlCl) (Oracle Database Console)

1 - About

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

Advertising

3 - Syntax

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

4 - 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.

5 - Example

See summary

5.1 - Grand Total

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

6 - How to

6.1 - list all compute definition

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

Advertising
lang/sqlplus/compute.txt · Last modified: 2017/09/13 16:04 by gerardnico