mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
poc: step aggr query feat: mvp poc stuff test: sqlness chore: import missing feat: support first/last_value fix: check also include first/last value
34 lines
483 B
SQL
34 lines
483 B
SQL
CREATE TABLE integers(
|
|
host STRING,
|
|
i BIGINT,
|
|
ts TIMESTAMP TIME INDEX
|
|
) PARTITION ON COLUMNS (host) (
|
|
host < '550-A',
|
|
host >= '550-A'
|
|
AND host < '550-W',
|
|
host >= '550-W'
|
|
);
|
|
|
|
-- count
|
|
EXPLAIN SELECT
|
|
count(i)
|
|
FROM
|
|
integers;
|
|
|
|
EXPLAIN SELECT
|
|
ts,
|
|
count(i)
|
|
FROM
|
|
integers
|
|
GROUP BY
|
|
ts;
|
|
|
|
EXPLAIN SELECT
|
|
date_bin('1 hour'::INTERVAL, ts),
|
|
count(i)
|
|
FROM
|
|
integers
|
|
GROUP BY
|
|
date_bin('1 hour'::INTERVAL, ts);
|
|
|
|
DROP TABLE integers; |