2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE if exists lc;
|
|
|
|
CREATE TABLE lc (a LowCardinality(Nullable(String)), b LowCardinality(Nullable(String))) ENGINE = MergeTree order by tuple();
|
|
|
|
INSERT INTO lc VALUES ('a', 'b');
|
|
|
|
INSERT INTO lc VALUES ('c', 'd');
|
2019-02-13 16:56:06 +00:00
|
|
|
|
2021-04-04 12:14:01 +00:00
|
|
|
SELECT a, b, count(a) FROM lc GROUP BY a, b WITH ROLLUP ORDER BY a, b;
|
|
|
|
SELECT a, count(a) FROM lc GROUP BY a WITH ROLLUP ORDER BY a;
|
2019-02-13 16:56:06 +00:00
|
|
|
|
2021-04-04 12:14:01 +00:00
|
|
|
SELECT a, b, count(a) FROM lc GROUP BY a, b WITH CUBE ORDER BY a, b;
|
|
|
|
SELECT a, count(a) FROM lc GROUP BY a WITH CUBE ORDER BY a;
|
2019-02-13 16:56:06 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE if exists lc;
|