mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-15 12:14:18 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
22 lines
404 B
SQL
22 lines
404 B
SQL
DROP TABLE IF EXISTS stored_aggregates;
|
|
|
|
CREATE TABLE stored_aggregates
|
|
(
|
|
d Date,
|
|
Uniq AggregateFunction(uniq, UInt64)
|
|
)
|
|
ENGINE = AggregatingMergeTree(d, d, 8192);
|
|
|
|
INSERT INTO stored_aggregates
|
|
SELECT
|
|
toDate('2014-06-01') AS d,
|
|
uniqState(number) AS Uniq
|
|
FROM
|
|
(
|
|
SELECT * FROM system.numbers LIMIT 1000
|
|
);
|
|
|
|
SELECT uniqMerge(Uniq) FROM stored_aggregates;
|
|
|
|
DROP TABLE stored_aggregates;
|