select-expression::={{column-specification|column-name}[AS
alias]
|{value-expression|aggregate-function}AS
alias}
Specifies the item to be output as the result of a search.
column-specification
For details about specifying columns, see 3.2.5(2) Column specification.
column-name
If there is only one relation reference in the FROM clause that follows, you can specify just a column name.
If the succeeding FROM clause references multiple relations, you must use a column specification.
alias
Specify a unique name in the following cases:
The alias must follow the standard naming rules. For details about the naming rules, see 3.2.4 Specifying names.
All alias names must be unique in any given SELECT clause. Also, you cannot specify a name that is the same as the table ID of another range variable. For details about range variables and table IDs, see 3.2.5 Name qualification.
value-expression
For details about specifying a value expression, see 4.4.19 Value expression.
If you specify a column name for the i-th select expression, that column name is used to reference the i-th column of the relation returned by the relation expression. If you do not specify a column name for the i-th select expression, the following occurs:
aggregate-function
For details about specifying an aggregate function, see 4.4.12 Aggregate functions.
A column specification or column name must be included in the argument of an aggregate function.
REGISTER QUERY q1 SELECT s1.c1 AS a1, s2.c1 AS a2 FROM s1[NOW], s2[NOW];
REGISTER QUERY q2 SELECT a1, a2 FROM q1 WHERE a1 > 1 GROUP BY a1, a2
HAVING a2 > 1;
REGISTER QUERY q1 SELECT s1.c1 AS a1, s2.c1 AS a2 FROM s1[NOW], s2[NOW]
WHERE a1 > 1 GROUP BY a1, a2 HAVING a2 > 1;
REGISTER QUERY q1 SELECT s1.c1, s1.c2+1 AS a1 ... ;
REGISTER QUERY q1 SELECT s1.c1, s1.c2+1 AS c1 ... ;
Only defined stream data can be used for specifying a select expression.
Outputs the data in columns a and b of relation s1. The underlined parts indicate select expressions.
REGISTER QUERY q1 SELECT s1.a, s1.b FROM s1[ROWS 100];