ClickHouse/tests/queries/0_stateless/00140_prewhere_column_order.sql
2022-06-23 11:24:54 +02:00

13 lines
440 B
SQL

DROP TABLE IF EXISTS prewhere;
set allow_deprecated_syntax_for_merge_tree=1;
CREATE TABLE prewhere (d Date, a String, b String) ENGINE = MergeTree(d, d, 8192);
INSERT INTO prewhere VALUES ('2015-01-01', 'hello', 'world');
ALTER TABLE prewhere ADD COLUMN a1 String AFTER a;
INSERT INTO prewhere VALUES ('2015-01-01', 'hello1', 'xxx', 'world1');
SELECT d, a, a1, b FROM prewhere PREWHERE a LIKE 'hello%' ORDER BY a1;
DROP TABLE prewhere;