select * from zzz
id amt
1 10
1 20
2 5
2 6
3 10
select id, sum(amt) over (partition by id order by id) sum from zzz
1 30
1 30
2 11
2 11
3 10
Why I'm getting duplicate rows??
Can't use distinct or group by as this is just a small demo and I'll be using my query as part of another complex join.