Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

SELECT

Returns rows from tables, views, and user-defined functions.

Note

The maximum size for a single SQL statement is 16 MB.

Syntax

Copy
[ WITH with_subquery [, ...] ] SELECT [ TOP number | [ ALL | DISTINCT ] * | expression [ AS output_name ] [, ...] ] [ FROM table_reference [, ...] ] [ WHERE condition ] [ GROUP BY expression [, ...] ] [ HAVING condition ] [ { UNION | ALL | INTERSECT | EXCEPT | MINUS } query ] [ ORDER BY expression [ ASC | DESC ] [ LIMIT { number | ALL } ] [ OFFSET start ]

On this page: