ClickHouse/tests/queries/0_stateless/00804_rollup_with_having.sql
Alexey Milovidov 9d47adbae6 Fix tests
2021-04-04 15:10:13 +03:00

15 lines
518 B
SQL

DROP TABLE IF EXISTS rollup_having;
CREATE TABLE rollup_having (
a Nullable(String),
b Nullable(String)
) ENGINE = Memory;
INSERT INTO rollup_having VALUES (NULL, NULL);
INSERT INTO rollup_having VALUES ('a', NULL);
INSERT INTO rollup_having VALUES ('a', 'b');
SELECT a, b, count(*) FROM rollup_having GROUP BY a, b WITH ROLLUP HAVING a IS NOT NULL ORDER BY a, b;
SELECT a, b, count(*) FROM rollup_having GROUP BY a, b WITH ROLLUP HAVING a IS NOT NULL and b IS NOT NULL ORDER BY a, b;
DROP TABLE rollup_having;