All pastes #811451 Raw Edit

hali

public sql v1 · immutable
·published 2007-12-10 22:48 UTC
rendered paste body
SQL> select * from p1;        ID A          B          C                   I---------- ---------- ---------- ---------- ----------         1 one        test1      test2               5         2 two        test1      test3               3         3 three      test1      test4               8         4 three      test1      test4              10SQL> select a,b,sum(i) over (partition by a) from p1 ;A          B          SUM(I)OVER(PARTITIONBYA)---------- ---------- ------------------------one        test1                             5three      test1                            18three      test1                            18two        test1                             3SQL> select a,b,sum(i) over (partition by b) from p1 ;A          B          SUM(I)OVER(PARTITIONBYB)---------- ---------- ------------------------one        test1                            26three      test1                            26three      test1                            26two        test1                            26SQL>