8. SQL Statements : SELECT (interactive) : Description
 
Share this page                  
Description
The SELECT (interactive) statement returns values from one or more specified tables or views, in the form of a single result table. Using the various clauses of the SELECT statement, the following can be specified:
Criteria for the values to be returned in the result table
How the values in the result table are to be sorted and grouped
In interactive SQL (ISQL) the results of a query are displayed on your terminal. In embedded SQL (ESQL), results are returned in host language variables. For details about using the SELECT statement in ESQL, see Select (embedded) (see page SELECT (embedded)).
The SELECT statement can be preceded by a common table expression (see page WITH (common_table_expression)).
Tip: User consumption of computing resources can be restricted during queries (selects) using the GRANT statement. Specifically, limits can be specified for I/O and for the number of rows returned. If the DBMS query optimizer estimates that a select exceeds the specified limits, the query is not executed. For details, see Grant (privilege) (see page GRANT (privilege)).
Note:  If II_DECIMAL is set to comma, you must follow any comma required in SQL syntax (such as a list of table columns or SQL functions with several parameters) by a space. For example:
SELECT col1, IFNULL(col2, 0), LEFT(col4, 22) FROM version;
The following sections describe the clauses of the SELECT statement, explain how to create simple queries, and explain how the results of a query are obtained.