select sum(field) from table1 group by floor(rownum/10);

解决方案 »

  1.   

    select quantity from 
    (select sum(quantity) over(order by rownum) quantity from table1)
    order by quantity desc
      

  2.   

    select sum(b.quantity )
    from table a, 
         table b
    where a.quantity <= b.quantity 
    group by a.quantity ;
      

  3.   

    不好意思,忘记说了要对数据库每条记录进行update
      

  4.   

    update table c 
    set c.quantity = ( select d.quantity_sum 
              from ( select a.quantity quantity,sum(b.quantity) quantity_sum
            from table a,table b
            where a.quantity <= b.quantity
            group by a.quantity ) d
     where c.quantity = d.quantity );