2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS rollup_having;
|
|
|
|
CREATE TABLE rollup_having (
|
2018-12-15 06:27:40 +00:00
|
|
|
a Nullable(String),
|
|
|
|
b Nullable(String)
|
|
|
|
) ENGINE = Memory;
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO rollup_having VALUES (NULL, NULL);
|
|
|
|
INSERT INTO rollup_having VALUES ('a', NULL);
|
|
|
|
INSERT INTO rollup_having VALUES ('a', 'b');
|
2018-12-15 06:27:40 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT a, b, count(*) FROM rollup_having GROUP BY a, b WITH ROLLUP HAVING a IS NOT NULL;
|
|
|
|
SELECT a, b, count(*) FROM rollup_having GROUP BY a, b WITH ROLLUP HAVING a IS NOT NULL and b IS NOT NULL;
|
2019-01-16 00:20:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE rollup_having;
|