Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

SELECT - Amazon Timestream

SELECT

SELECT statements can be used to retrieve data from one or more tables. Timestream's query language supports the following syntax for SELECT statements:

[ WITH with_query [, ...] ] SELECT [ ALL | DISTINCT ] select_expr [, ...] [ function (expression) OVER ( [ PARTITION BY partition_expr_list ] [ ORDER BY order_list ] [ frame_clause ] ) [ FROM from_item [, ...] ] [ WHERE condition ] [ GROUP BY [ ALL | DISTINCT ] grouping_element [, ...] ] [ HAVING condition] [ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select ] [ ORDER BY order_list ] [ LIMIT [ count | ALL ] ]

where

  • function (expression) is one of the supported window functions.

  • partition_expr_list is:

    expression | column_name [, expr_list ]
  • order_list is:

    expression | column_name [ ASC | DESC ] [ NULLS FIRST | NULLS LAST ] [, order_list ]
  • frame_clause is:

    ROWS | RANGE { UNBOUNDED PRECEDING | expression PRECEDING | CURRENT ROW } | {BETWEEN { UNBOUNDED PRECEDING | expression { PRECEDING | FOLLOWING } | CURRENT ROW} AND { UNBOUNDED FOLLOWING | expression { PRECEDING | FOLLOWING } | CURRENT ROW }}
  • from_item is one of:

    table_name [ [ AS ] alias [ ( column_alias [, ...] ) ] ] from_item join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ]
  • join_type is one of:

    [ INNER ] JOIN LEFT [ OUTER ] JOIN RIGHT [ OUTER ] JOIN FULL [ OUTER ] JOIN
  • grouping_element is one of:

    () expression
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.