4. SQL Statements : SELECT
 
Share this page                  
SELECT
Valid in: SQL
The SELECT (interactive) statement returns values from tables or views.
Notes:
SELECT queries that access both Vector and standard Ingres tables cannot execute.
Similarly, INSERT...SELECT and CREATE AS SELECT do not work if the SELECT statement references both Vector and Ingres tables.
This statement has the following format:
[WITH common_table_expression]
SELECT [FIRST rowCount] [ALL | DISTINCT] * | expression [AS result_column]
              {, expression [[AS] result_column]}
              [FROM from_source {, from_source}
              [WHERE search_condition] WHERE (clause)
              [GROUP BY [ALL | DISTINCT] grouping element {, grouping element}]
              [HAVING search_condition] HAVING (clause)
              {UNION [ALL] | INTERSECT | EXCEPT
              (select)}
              [ORDER BY ordering-expression [ASC | DESC]
                            {, ordering-expression [ASC | DESC]}
                                [NULLS {FIRST | LAST}]];
              [WITH options]
Syntax elements are described in WITH common table expression (see WITH (common_table_expression)) and SELECT Statement Clauses.