ClickHouse/tests/queries/0_stateless/01137_order_by_func.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
877 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS pk_func;
2023-08-12 17:31:18 +00:00
CREATE TABLE pk_func(d DateTime, ui UInt32) ENGINE = MergeTree ORDER BY toDate(d) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi';
INSERT INTO pk_func SELECT '2020-05-05 01:00:00', number FROM numbers(1000000);
INSERT INTO pk_func SELECT '2020-05-06 01:00:00', number FROM numbers(1000000);
INSERT INTO pk_func SELECT '2020-05-07 01:00:00', number FROM numbers(1000000);
SELECT * FROM pk_func ORDER BY toDate(d), ui LIMIT 5;
DROP TABLE pk_func;
2020-05-09 16:19:47 +00:00
DROP TABLE IF EXISTS nORX;
2023-08-12 17:31:18 +00:00
CREATE TABLE nORX (`A` Int64, `B` Int64, `V` Int64) ENGINE = MergeTree ORDER BY (A, negate(B)) SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi';
2020-05-06 22:48:44 +00:00
INSERT INTO nORX SELECT 111, number, number FROM numbers(10000000);
2020-05-06 22:48:44 +00:00
SELECT *
FROM nORX
WHERE B >= 1000
ORDER BY
A ASC,
-B ASC
LIMIT 3
SETTINGS max_threads = 1;
2020-05-06 22:48:44 +00:00
DROP TABLE nORX;