Sql*Plus User’s Guide and Reference


Download 5.34 Mb.
Pdf ko'rish
bet89/103
Sana04.08.2023
Hajmi5.34 Mb.
#1665146
1   ...   85   86   87   88   89   90   91   92   ...   103
Bog'liq
E18404-12


Partners 13500
Page: 3
DEPARTMENT_ID JOB_ID LAST_NAME SALARY
------------- ---------- ------------------------- ----------
90 AD_PRES King 24000
AD_VP Kochhar 17000
De Haan 17000
6 rows selected.


Clarifying Your Report with Spacing and Summary Lines
Formatting SQL*Plus Reports
6-13
... ON 
break_column_2
The COMPUTE command has no effect without a corresponding BREAK command.
You can COMPUTE on NUMBER columns and, in certain cases, on all types of 
columns. For more information see the 
COMPUTE
 command on page 12-34.
The following table lists compute functions and their effects
The function you specify in the COMPUTE command applies to all columns you enter 
after OF and before ON. The computed values print on a separate line when the value 
of the ordered column changes.
Labels for ON REPORT and ON ROW computations appear in the first column
otherwise, they appear in the column specified in the ON clause.
You can change the compute label by using COMPUTE LABEL. If you do not define a 
label for the computed value, SQL*Plus prints the unabbreviated function keyword.
The compute label can be suppressed by using the NOPRINT option of the COLUMN 
command on the break column. See the 
COMPUTE
 command on page 12-34 for more 
details. If you use the NOPRINT option for the column on which the COMPUTE is 
being performed, the COMPUTE result is also suppressed. 
Example 6–13
Computing and Printing Subtotals 
To compute the total of SALARY by department, first list the current BREAK 
definition:
BREAK
which displays current BREAK definitions:
Now enter the following COMPUTE command and run the current query:
COMPUTE SUM OF SALARY ON DEPARTMENT_ID
/

Download 5.34 Mb.

Do'stlaringiz bilan baham:
1   ...   85   86   87   88   89   90   91   92   ...   103




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling