ClickHouse/tests/queries/0_stateless/00527_totals_having_nullable.sql

3 lines
284 B
MySQL
Raw Normal View History

SELECT count() AS x WITH TOTALS HAVING x != toNullable(0);
SELECT k, count() AS c FROM (SELECT number, CASE WHEN number < 10 THEN 'hello' WHEN number < 50 THEN 'world' ELSE 'goodbye' END AS k FROM system.numbers LIMIT 100) GROUP BY k WITH TOTALS HAVING nullIf(c, 10) < 50 ORDER BY c;