ALLBASE/SQL Reference Manual (36216-90216)

Chapter 12 505
SQL Statements S - Z
SELECT
SQL Syntax — Query Block Level
SELECT [ALL
DISTINCT]
SelectList
[INTO
HostVariableSpecification
]
FROM
FromSpec
[,...]
[WHERE
SearchCondition1
]
[GROUP BY
GroupColumnList
]
[HAVING
SearchCondition2
]
Parameters — Query Block Level
ALL prevents elimination of duplicate rows from the result. If neither ALL nor
DISTINCT is specified, the ALL option is assumed.
Numeric One FLOAT or REAL FLOAT
Both DECIMAL DECIMAL If p1 and s1 are the precision
and scale of C1, and p2 and
s2 are the precision and
scale of C2, the precision and
scale of the result column is
as follows: MIN(27,
MAX(s1,s2) +
MAX(p1-s1, p2-s2)) and
the following is the scale of
the result column:
MAX(s1,s2)
One DECIMAL, one
SMALLINT or
INTEGER
DECIMAL Precision and scale are
derived as above. The
precision and scale for an
integer is (10,0); for a
smallint, (5,0).
One INTEGER, one
SMALLINT
INTEGER
Date/Time Both DATE, TIME,
DATETIME, or
INTERVAL
DATE, TIME,
DATETIME, or
INTERVAL,
respectively
One CHAR or
VARCHAR and one
DATE, TIME,
DATETIME, or
INTERVAL
DATE, TIME,
DATETIME, or
INTERVAL,
respectively
Binary One BINARY, one
VARBINARY
VARBINARY Result has length of the
longer of the two source
columns.
Table 12-1. Conversion Rules for Data in Query Expressions
Data Type Source Columns Result Column Comment