select A
,sum(REC) over(partition by A) sum1
,B
,sum(REC) over(partition by A,B) sum2
,C
,sum(REC) over(partition by A,B,C) sum3
from
TABLE
;
,sum(REC) over(partition by A) sum1
,B
,sum(REC) over(partition by A,B) sum2
,C
,sum(REC) over(partition by A,B,C) sum3
from
TABLE
;