mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
16 lines
299 B
MySQL
16 lines
299 B
MySQL
|
CREATE TABLE t
|
||
|
(
|
||
|
`d` Date,
|
||
|
`s` LowCardinality(FixedString(3)),
|
||
|
`c` UInt32
|
||
|
)
|
||
|
ENGINE = SummingMergeTree()
|
||
|
PARTITION BY d
|
||
|
ORDER BY (d, s);
|
||
|
|
||
|
INSERT INTO t (d, s, c) VALUES ('2020-01-01', 'ABC', 1);
|
||
|
INSERT INTO t (d, s, c) VALUES ('2020-01-01', 'ABC', 2);
|
||
|
|
||
|
OPTIMIZE TABLE t;
|
||
|
SELECT * FROM t;
|