mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
19 lines
721 B
SQL
19 lines
721 B
SQL
DROP TABLE IF EXISTS array_pk;
|
|
CREATE TABLE array_pk (key Array(UInt8), s String, n UInt64, d Date MATERIALIZED '2000-01-01') ENGINE = MergeTree(d, (key, s, n), 1);
|
|
|
|
INSERT INTO array_pk VALUES ([1, 2, 3], 'Hello, world!', 1);
|
|
INSERT INTO array_pk VALUES ([1, 2], 'Hello', 2);
|
|
INSERT INTO array_pk VALUES ([2], 'Goodbye', 3);
|
|
INSERT INTO array_pk VALUES ([], 'abc', 4);
|
|
INSERT INTO array_pk VALUES ([2, 3, 4], 'def', 5);
|
|
INSERT INTO array_pk VALUES ([5, 6], 'ghi', 6);
|
|
|
|
SELECT * FROM array_pk ORDER BY n;
|
|
|
|
DETACH TABLE array_pk;
|
|
ATTACH TABLE array_pk (key Array(UInt8), s String, n UInt64, d Date MATERIALIZED '2000-01-01') ENGINE = MergeTree(d, (key, s, n), 1);
|
|
|
|
SELECT * FROM array_pk ORDER BY n;
|
|
|
|
DROP TABLE array_pk;
|