sum():
select sum(your_number_field) from your_table where ...

解决方案 »

  1.   

    sum()是算总和.我要的是累加.
    比如第三行应该是前两项之和
      

  2.   

    select dept_id,dept_name,sum(sal) over(partition by dept_id order by sal) from table_name order by dept_id,sal
      

  3.   

    select dept_id,dept_name,sum(sal) over(partition by dept_id order by sal) from table_name order by dept_id,sal
      

  4.   

    用9i的Windowing Aggregate Functions
      

  5.   

    beckhambobo(beckham)大哥,你的SQL是可解啊?
      

  6.   

    例如表是如下
    列:AA BB
        a1  1
        a2 10
        a3 30
    通过Select AA,BB,?? cc from tab1 ……
    出来的结果是
    AA BB cc
    a1  1  1
    a2 10 11
    a3 30 41请教??如何写
      

  7.   

    select aa,bb,sum(bb) over(order by rownum) cc from tab1
      

  8.   

    OVER?
    不行啊,显示错误!
    ORA-00923: FROM keyword not found where expected