one more test

This commit is contained in:
chertus 2019-01-25 16:15:29 +03:00
parent 5a916860ef
commit 02f236e457
2 changed files with 9 additions and 0 deletions

View File

@ -20,3 +20,11 @@ ARRAY JOIN
WHERE CounterID = 100500;
DROP TABLE test.visits;
select u, cumSum from (
select u, min(d) mn, max(d) mx, groupArray(d) dg, groupArray(v) vg,
arrayMap(x -> x + mn, range(toUInt32(mx - mn + 1))) days,
toString(arrayCumSum(arrayMap( x -> vg[indexOf(dg, x)] , days))) cumSum
from (select 1 u, today()-1 d, 1 v)
group by u
);