blob: f1010525803406e3e5a42ce0371861ca02cd08d4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
/* postgres can not */
use plato;
$data = (select cast(key as uint32) as age, cast(subkey as uint32) as region, value as name from Input);
--insert into Output
select
prefix,
region,
name,
sum(age) over w1 as sum1
from $data
window w1 as (partition by SUBSTRING(name,0,1) as prefix order by name)
order by prefix, region, name;
|