ClickHouse/tests/queries/0_stateless/01518_nullable_aggregate_states1.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
913 B
MySQL
Raw Normal View History

2020-10-19 00:10:50 +00:00
select count(), count(a), max(a), min(a), avg(a), sum(a), any(a)
from (select cast(Null,'Nullable(Float64)') a);
select countMerge(cnts), countMerge(cntsa), maxMerge(maxs), minMerge(mins), avgMerge(avgs), sumMerge(sums), anyMerge(anys) from (
select countState() cnts, countState(a) cntsa, maxState(a) maxs, minState(a) mins, avgState(a) avgs, sumState(a) sums, anyState(a) anys
from (select cast(Null,'Nullable(Float64)') a));
select '--- empty resultset ---';
select count(), count(a), max(a), min(a), avg(a), sum(a), any(a)
from (select cast(1,'Nullable(Float64)') a) where a =0;
select countMerge(cnts), countMerge(cntsa), maxMerge(maxs), minMerge(mins), avgMerge(avgs), sumMerge(sums), anyMerge(anys) from (
select countState() cnts, countState(a) cntsa, maxState(a) maxs, minState(a) mins, avgState(a) avgs, sumState(a) sums, anyState(a) anys
from (select cast(1,'Nullable(Float64)') a) where a =0 );