ClickHouse/tests/queries/0_stateless/00214_primary_key_order.sql
Alexander Tokmakov c068593a0d fix tests
2022-06-23 12:58:34 +02:00

16 lines
480 B
SQL

DROP TABLE IF EXISTS primary_key;
set allow_deprecated_syntax_for_merge_tree=1;
CREATE TABLE primary_key (d Date DEFAULT today(), x Int8) ENGINE = MergeTree(d, -x, 1);
INSERT INTO primary_key (x) VALUES (1), (2), (3);
SELECT x FROM primary_key ORDER BY x;
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);
DROP TABLE primary_key;