2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS primary_key;
|
|
|
|
CREATE TABLE primary_key (d Date DEFAULT today(), x Int8) ENGINE = MergeTree(d, -x, 1);
|
2015-08-18 20:44:54 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO primary_key (x) VALUES (1), (2), (3);
|
2015-08-18 20:44:54 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT x FROM primary_key ORDER BY x;
|
2015-08-18 20:44:54 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT 'a', -x FROM primary_key WHERE -x < -3;
|
|
|
|
SELECT 'b', -x FROM primary_key WHERE -x < -2;
|
|
|
|
SELECT 'c', -x FROM primary_key WHERE -x < -1;
|
|
|
|
SELECT 'd', -x FROM primary_key WHERE -x < toInt8(0);
|
2015-08-18 20:44:54 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE primary_key;
|