mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 04:22:03 +00:00
10 lines
319 B
SQL
10 lines
319 B
SQL
DROP TABLE IF EXISTS sales;
|
|
|
|
CREATE TABLE sales (DATE_SOLD DateTime64(3, 'UTC'), PRODUCT_ID Nullable(String)) Engine MergeTree() PARTITION BY toYYYYMM(DATE_SOLD) ORDER BY DATE_SOLD;
|
|
|
|
ALTER TABLE sales ADD PROJECTION test (SELECT toInt64(COUNT(*)) GROUP BY PRODUCT_ID, DATE_SOLD);
|
|
|
|
SHOW CREATE sales;
|
|
|
|
DROP TABLE sales;
|