-- { 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 SELECT * FROM numbers(10) LIMIT 5 OFFSET 2; 3 4 5 6