SELECT
SELECT queries data from one or more tables, views, or materialized views. SELECT can work as an independent statement or a clause nested in other statements. The output of the SELECT clause can be used as the input of other statements.
StarRocks' query statement basically conforms to the SQL92 standard.
To query data from tables, views, or materialized views in a StarRocks internal table, you must have the SELECT privilege on these objects. To query data from tables, views, or materialized views in an external data source, you must have the USAGE privilege on the corresponding external catalog.
Syntaxβ
SELECT select_list FROM table_reference [, ...]
The SELECT statement generally consists of the following clauses:
- Common Table Expression (CTE)
- JOINs
- ORDER BY
- GROUP BY
- HAVING
- LIMIT
- OFFSET
- UNION
- INTERSECT
- EXCEPT/MINUS
- DISTINCT
- Subquery
- WHERE and operators
- Alias
- PIVOT
- EXCLUDE
For detailed instructions, refer to the corresponding topics.