ISQL Statements

Thursday

1 record selected

ISQL> column sysdate format "Month" ISQL> select sysdate from syscalctable

SYSDATE

-------

May

1 record selected

ISQL> column sysdate format "DDth" ISQL> select sysdate from syscalctable

SYSDATE

-------

7th

1 record selected

Note: If the select-list of a query includes column titles, they override formatting specified in COLUMN statements for those columns. The following example illustrates this behav- ior.

ISQL> select fld from syscalctable; -- No formatting

FLD

---

100

1 record selected

ISQL> column fld heading "column title" -- Specify heading in COLUMN statement ISQL> select fld from syscalctable;

COLUMN TITLE

------------

100

1 record selected

ISQL> select fld "new title" from syscalctable; -- Specify title in select list

NEW TITLE

---------

100

1 record selected

3.7.5COMPUTE

Syntax

COMPUTE

[ { AVG MAX MIN SUM COUNT } OF column_name

IN variable_name

ON break_spec ] ; break_spec::

{ column_name ROW PAGE REPORT }

Description

Performs aggregate function computations on column values for the specified set of rows, and assigns the results to a variable. DISPLAY statements can then refer to the variable to display its value.

FairCom Corporation

3-21

Page 47
Image 47
HP c-tree-SQL ISQL and Tools manual Fld, Column Title, NEW Title, Compute