2020-02-11 18:05:08 +00:00
|
|
|
DROP TABLE IF EXISTS count;
|
2019-10-29 14:26:43 +00:00
|
|
|
|
2023-08-13 18:29:59 +00:00
|
|
|
CREATE TABLE count (x UInt64) ENGINE = MergeTree ORDER BY tuple() SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi';
|
2020-02-11 18:05:08 +00:00
|
|
|
INSERT INTO count SELECT * FROM numbers(1234567);
|
2019-10-29 14:26:43 +00:00
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
SELECT count() FROM count;
|
|
|
|
SELECT count() * 2 FROM count;
|
|
|
|
SELECT count() FROM (SELECT * FROM count UNION ALL SELECT * FROM count);
|
|
|
|
SELECT count() FROM count WITH TOTALS;
|
|
|
|
SELECT arrayJoin([count(), count()]) FROM count;
|
|
|
|
SELECT arrayJoin([count(), count()]) FROM count LIMIT 1;
|
|
|
|
SELECT arrayJoin([count(), count()]) FROM count LIMIT 1, 1;
|
|
|
|
SELECT arrayJoin([count(), count()]) AS x FROM count LIMIT 1 BY x;
|
|
|
|
SELECT arrayJoin([count(), count() + 1]) AS x FROM count LIMIT 1 BY x;
|
|
|
|
SELECT count() FROM count HAVING count() = 1234567;
|
|
|
|
SELECT count() FROM count HAVING count() != 1234567;
|
2019-10-29 14:26:43 +00:00
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
DROP TABLE count;
|