ClickHouse/dbms/tests/queries/0_stateless/00931_low_cardinality_nullable_aggregate_function_type.sql
2019-04-05 19:52:43 +03:00

9 lines
369 B
SQL

drop table if exists test.lc;
CREATE TABLE test.lc (`date` Date, `name` LowCardinality(Nullable(String)), `clicks` Nullable(Int32)) ENGINE = MergeTree() ORDER BY date SETTINGS index_granularity = 8192;
INSERT INTO test.lc SELECT '2019-01-01', null, 0 FROM numbers(1000000);
SELECT date, argMax(name, clicks) FROM test.lc GROUP BY date;
drop table if exists test.lc;