blob: 7785cf9eb90fa105df3818190c0e03563607b93b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/* postgres can not */
use plato;
$foo = (
select key, subkey, value,
sum(cast(subkey as uint32)) over w as sks
from Input
window w as (partition by key order by subkey)
);
$bar = (
select key, subkey,
sum(cast(subkey as uint32)) over w as sks,
avg(cast(subkey as uint32)) over w as ska
from Input4
window w as (partition by key order by subkey)
);
select key,subkey, value from $foo order by key, subkey;
select key,ska from $bar order by key,ska;
|