A column select expression is a select expression that specifies a one-column result table in one row and can be nested within predicates and (if they specify a single value) value expressions. Column select expressions cannot specify a list of select items. You can only specify one value in a select list. Column select expressions are also called scalar expressions. SQL accepts column select expressions as arguments to IN and quantified predicates, and more generally as value expressions. o As arguments to IN and quantified predicates, column select expressions specify a collection of values to which SQL compares a value expression. Therefore, column select expressions as arguments to those predicates can return one or more values. o As a type of value expression, column select expressions specify a single value. Therefore, a column select expression used as a value expression should not return more than one value. If it does, SQL generates the following error: %RDB-E-MULTIPLE_MATCH, record selection criteria should identify only one record; more than one record found If a column select expression used as a value expression returns zero rows, SQL evaluates the value expression as null. The data type of a column select expression used as a value expression is the same as the data type of the column select expression's select item.
1 – Environment
You can use column select expressions in interactive SQL or in host language programs.
2 – Format
col-select-expr = ---> select-expr -------> select-expr = -+-+-> select-clause ------------+-+------+ | +-> ( select-expr ) -----------+ | | | +-> TABLE table-ref ----------+ | | +------ select-merge-clause <-------+ | +------------------- <-------------------+ +-+--------------------+--+------------------+--+--------------------+-> +-> order-by-clause -+ +-> offset-clause -+ +-> limit-to-clause -+
3 – Arguments
3.1 – select-expr
A column select expression is a select expression specifying only one value in the select list. See Select_Expressions for more information.