RemainIntegral 的值是他前面的 getintegral 的和改怎么写啊!? 请高手帮忙!

解决方案 »

  1.   

    getintegral  RemainIntegral  16              16
     18              34
     15              49不好意思图片没显示出来!
      如上面我写的
      

  2.   

    select sum(getintegral)over(parition by 1 order by 1)from 表
      

  3.   

    select sum(getintegral)over(parition by 1 order by getintegral)from 表
      

  4.   

     好像不行哦 确实右括号
      我要得到的是 很多条记录 而不是一条
      没条记录的 getintegral  RemainIntegral 
     的值 如上面我所说的 
      

  5.   

    with t
    as
    (
    select 16 a from dual
    union all
    select 18 from dual
    union all
    select 19 from dual
    )
    select a, sum(a)over(partition by 1 order by a) b from t
      

  6.   


    with t
    as
    (
    select 16 a from dual
    union all
    select 18 from dual
    union all
    select 19 from dual
    )
    select a, sum(a)over(partition by 1 order by a) b from t
    --直接运行,结果如下:
    16 16
    18 34
    19 53
      

  7.   


    select getintegral,sum(getintegral)over(order by rownum rows between unbounded preceding and current row)RemainIntegral from table1
    这个例子里,按rownum排序的话,可以不用加rows bet...
    但是如果排序的对象值重复的话,可能会出错