SELECT returns rows from a table.
SELECT select_expr [ AS alias ] [, ...] FROM table_name [ WHERE where_expr ] [ GROUP BY group_expr ] [ TIMESERIES timeseries_expr ] [ ORDER BY order_by_expr ] [ LIMIT count ]
Expressions that form the output rows. Standard modifiers (
*,+,-,\,%) and groupings are supported. Aggregate functions can be used over columns.
The following aggregate functions are supported:
The name of the table.
The WHERE expression is a boolean expression used to filter rows from the result.
You may group
( ) boolean expressions together forming arbitrary expression trees using
!=, and comparison operators
<= are supported.
Calculations may also be applied using standard operators such as (
GROUP BY column_name [, ...]
Groups non-aggregate columns into groups of matching rows.
TIMESERIES [ BY column_name ] amount_expr
TIMESERIES is an expression specific to Hyprcubd. It is used to generate a series of timestamps over the select query.
BY column_nameis optional. The default column used is
- amount_expr is a number followed by a unit.
What is the average hourly temperature by city over the last day?
SELECT time, city, AVG(temp) FROM temps WHERE time >= '2020-04-27' and time < '2020-04-28' GROUP BY city TIMESERIES 1h ORDER BY time
ORDER BY column_name [, ...]
Performs a sort
Limit the number of rows