ClickHouse/tests/queries/0_stateless/02565_analyzer_limit_settings.reference
2023-02-27 19:44:37 +00:00

71 lines
1.2 KiB
Plaintext

-- { echoOn }
SET limit = 0;
SELECT * FROM numbers(10);
0
1
2
3
4
5
6
7
8
9
SELECT * FROM numbers(10) SETTINGS limit=5, offset=2;
2
3
4
5
6
SELECT count(*) FROM (SELECT * FROM numbers(10));
10
SELECT count(*) FROM (SELECT * FROM numbers(10) SETTINGS limit=5);
5
SELECT count(*) FROM (SELECT * FROM numbers(10)) SETTINGS limit=5;
10
SELECT count(*) FROM view(SELECT * FROM numbers(10));
10
SELECT count(*) FROM view(SELECT * FROM numbers(10) SETTINGS limit=5);
5
SELECT count(*) FROM view(SELECT * FROM numbers(10)) SETTINGS limit=5;
10
SET limit = 3;
SELECT * FROM numbers(10);
0
1
2
SELECT * FROM numbers(10) SETTINGS limit=5, offset=2;
2
3
4
5
6
SELECT count(*) FROM (SELECT * FROM numbers(10));
10
SELECT count(*) FROM (SELECT * FROM numbers(10) SETTINGS limit=5);
5
SELECT count(*) FROM (SELECT * FROM numbers(10)) SETTINGS limit=5;
10
SELECT count(*) FROM view(SELECT * FROM numbers(10));
10
SELECT count(*) FROM view(SELECT * FROM numbers(10) SETTINGS limit=5);
5
SELECT count(*) FROM view(SELECT * FROM numbers(10)) SETTINGS limit=5;
10
SET limit = 4;
SET offset = 1;
SELECT * FROM numbers(10);
1
2
3
4
SELECT * FROM numbers(10) LIMIT 3 OFFSET 2;
3
4
5
SELECT * FROM numbers(10) LIMIT 5 OFFSET 2;
3
4
5
6