SAND CDBMS SQL Reference Guide
SELECT

 

Previous Topic:
Group/Order Expression Clause
Chapter Index
Next Topic:
Optional SELECT Clauses

 

Description of SELECT Clauses


ALL

The ALL keyword dictates that all rows satisfying the selection criteria be retrieved, including duplicates. ALL is the default, and is implicit if no keyword is entered after SELECT.

DISTINCT
The DISTINCT keyword dictates that duplicate rows be omitted from query results.

AS
The AS clause can be used to name result columns in a SELECT clause. This is particularly useful for a column derived from an expression or from a function applied to a column value. Note that the AS keyword itself is optional.

The name of a result column is determined as follows:


FROM
This keyword introduces a list of tables, views, subqueries, and joined tables from which data is retrieved; list items are separated by commas. The FROM clause must be included in a SELECT statement. Data retrieval is limited to the tables (or views) specified. When more than one table expression is specified in the FROM clause, each of these object names can also be assigned a correlation name or alias.

Correlation names are used in place of the actual table or view name when qualifying columns within a query statement. The correlation name appears immediately after the corresponding table or view name in the FROM clause (separated by a single space). Correlation names must satisfy the same naming conventions as table names (except that they cannot be delimited by quotation marks), and must be unique among all table, view, and other correlation names within a query. The correlation name qualifies columns that appear in either SELECT or WHERE clauses.

SAND CDBMS allows the explicit specification of inner joins, right, left, and full outer joins, and left/right match joins, as well as the use of nested table expressions in the FROM clause. Consult the sections on Joins and Subqueries for more information.