ClickHouse/tests/queries/0_stateless/00331_final_and_prewhere.sql
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

13 lines
542 B
SQL

DROP TABLE IF EXISTS replace;
CREATE TABLE replace ( EventDate Date, Id UInt64, Data String, Version UInt32) ENGINE = ReplacingMergeTree(EventDate, Id, 8192, Version);
INSERT INTO replace VALUES ('2016-06-02', 1, 'version 1', 1);
INSERT INTO replace VALUES ('2016-06-02', 2, 'version 1', 1);
INSERT INTO replace VALUES ('2016-06-02', 1, 'version 0', 0);
SELECT * FROM replace ORDER BY Id, Version;
SELECT * FROM replace FINAL ORDER BY Id, Version;
SELECT * FROM replace FINAL WHERE Version = 0 ORDER BY Id, Version;
DROP TABLE replace;