Entering content frame

Selected Column (select_column) 

Selected columns (select_column) must be specified in a QUERY specification (query_spec) or a QUERY specification (named_query_spec) to specify a result table.

The sequence of selected columns defines the columns in the result table. The columns in the result table are produced from the columns of the temporary result table and by the rowno columns or stamp columns, if these exist. The columns of the temporary result table are determined by the FROM clause of the table expression. The order of the column names in the temporary result table is determined by the order of the table names in the FROM clause.

Syntax

<select_column> ::= <table_columns> | <derived_column> | <rowno_column> | <stamp_column>

<table_columns> ::= * | <table_name>.* | <reference_name>.*
<derived_column> ::= <expression> [ [AS] <result_column_name>] | <result_column_name> = <expression>
<rowno_column> ::= ROWNO [<result_column_name>] | <result_column_name> = ROWNO
<stamp_column> ::= STAMP [<result_column_name>] | <result_column_name> = STAMP

<result_column_name> ::= <identifier>
table_name, reference_name, expression, identifier

Explanation

Every column name that is specified as a selected column must uniquely denote a column in a QUERY specification (query spec) of the underlying tables. If necessary, the column name must be qualified with the table name.

The specification of a column with the data type LONG in a selected column is only valid in the uppermost sequence of selected columns in a QUERY statement or SINGLE SELECT statement if the DISTINCT specification was not used there.

The specification of a column with the data type LONG in a selected column is only valid in the uppermost sequence of select columns in a CREATE VIEW statement which is based on exactly one base table.

If a selected column contains a set function (set function spec), the sequence of selected columns to which the selected column belongs must not contain any table columns, and every column name occurring in an expression must denote a grouping column, or the expression must consist of grouping columns.

It is possible to specify scalar subqueries.

Each column of a result table has exactly the same data type, the same length, the same precision, and the same scale as the derived column or the column underlying the table columns.

This does not apply to the data types DATE and TIMESTAMP. To enable the representation of any date and time format, the length of the result table column is set to the maximum length required for the representation of a date value (length 10) or a timestamp value (length 26).

Leaving content frame