ALLBASE/SQL Reference Manual (36216-90216)

Chapter 12 509
SQL Statements S - Z
SELECT
Indicator
names an indicator variable, an output host variable whose value (see
following) depends on whether the host variable contains a null value:
0 the column's value is not NULL
1 the column's value is NULL
> 0 is truncated; the number indicates the data length before
truncation
The order of the host variables must match the order of their corresponding items in the
select list.
SQL Syntax — FromSpec
{
TableSpec
(
FromSpec
)
FromSpec
NATURAL [INNER
LEFT [OUTER]
RIGHT [OUTER]] JOIN {
TableSpec
(
FromSpec
)}
FromSpec
[INNER
LEFT [OUTER]
RIGHT [OUTER]] JOIN {
TableSpec
(
FromSpec
)}{ON
SearchCondition3
USING (
ColumnList
)}}
Parameters — FromSpec
TableSpec
identifies a table or view from which rows are selected.
The syntax for a
TableSpec
in a
FromSpec
follows:
[
Owner
.]
TableName
[
CorrelationName
]
[
Owner
.]
TableName
identifies a table or view to be referenced. The
TableName
may be preceded by an
OwnerName
, and may
be followed by the definition of a
CorrelationName
.
CorrelationName
specifies a synonym for the immediately preceding
table or view. The correlation name can be used instead of
the actual table or view name anywhere within the
SELECT statement when accessing columns or TID values
of that table.
The correlation name must conform to the syntax rules for
a basic name. All correlation names within one SELECT
statement must be unique. They cannot be the same as
any table name or view name in the FROM clause that
does not also have a correlation name associated with it.
Correlation names are useful when you join a table to
itself. You name the table twice in the FROM clause, and
assign it two different correlation names.
(
FromSpec
) allows the placement of parentheses around a
FromSpec
in order to alter
the order of evaluation of the components of a complex
FromSpec
, such as