Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> using the result of a partial sum in a where clause
Hi
I have a table like this:
Date Value 01/01/2002 1 01/07/2002 3 01/09/2002 2 02/03/2002 9 03/10/2002 5
I want to get the date in wich the sum of its asigned value and its predecesors is greater or equal than a supplied parameter. For example, if the parameter = 5, the query should return 01/09/2002, (1 + 3 + 2 > 5).
It can be done easily with a explicit cursor but, can a standard sql query be used?
Thanks in advance
Adrián Garrido
Received on Tue Jun 18 2002 - 12:17:09 CDT