Quote Originally Posted by suneeshsnair

Code:
select myamount,mydate 
from (select mydate , myamount, 
                 sum (myamount) 
    over (order by mydate,myamount rows unbounded preceding )
 as sum_amount from mytable ) 
where sum_amount<= 1000
I think you do not need myamount in the order by clause.
Try this:
over (order by mydate rows unbounded preceding )

And see you get the same result set.

Tamil