SELECT clauses

The
SELECT
statement supports the
ALL
and
DISTINCT
set quantifiers. You cannot use
CASE
and
WHEN
expressions.
  • FROM
    TIP:
    You can use subqueries for the
    FROM
    and for the
    IN
    predicate.
    The
    FROM
    clause is required, other clauses are optional.
    The clauses must have the following order:
    FROM
    ,
    WHERE
    ,
    GROUP
    ,
    HAVING
    ,
    ORDER
    ,
    LIMIT
    .
  • JOIN
  • AS
    TIP: Aliases for tables and columns support regular and delimited identifiers.
  • WHERE
  • GROUP BY
  • ORDER BY
  • Set function, including:
    COUNT
    ,
    MAX
    ,
    MIN
    ,
    AVG
    , and
    SUM
    .
  • HAVING
  • LIMIT
    TIP:
    Use the
    LIMIT OFFSET
    variant to limit the number of records. The offset is optional and its default value is
    0
    .
    For example,
    SELECT * FROM Table1 LIMIT 1000 OFFSET 10
    returns 1000 records starting from the record number 10.

Examples

The following are examples of
SELECT
clauses:
SELECT *, FROM Table1
SELECT *, Timestamp AS T FROM Table1
SELECT Column1 FROM Table1
SELECT *, 10 FROM Table1
SELECT 10, * FROM Table1
SELECT *, 'text value' FROM Table1
SELECT COUNT(*) FROM Table1
SELECT DISTINCT Column1 FROM Table1
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.