ClickHouse/tests/queries/0_stateless/00046_stored_aggregates_simple.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
450 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS stored_aggregates;
2014-06-06 17:19:40 +00:00
2022-06-23 08:37:52 +00:00
set allow_deprecated_syntax_for_merge_tree=1;
CREATE TABLE stored_aggregates
2014-06-06 17:19:40 +00:00
(
d Date,
Uniq AggregateFunction(uniq, UInt64)
)
ENGINE = AggregatingMergeTree(d, d, 8192);
INSERT INTO stored_aggregates
2014-06-06 17:19:40 +00:00
SELECT
toDate('2014-06-01') AS d,
uniqState(number) AS Uniq
FROM
(
SELECT * FROM system.numbers LIMIT 1000
);
SELECT uniqMerge(Uniq) FROM stored_aggregates;
2014-06-06 17:19:40 +00:00
DROP TABLE stored_aggregates;