Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: A bit more complicated than that
On 12 Jan 2003 21:57:29 -0600, tyutuyt_at_gfd.com (sfdsf) wrote:
>its not just a runnin total. in your example the amount is set just for the
>1st year i.e. year 1 = 3. the the amount for year 2 would be 3 + something
>(say 2) giving 5
>
>year amouint tax total
>
>1 3 2 5
>2 5 2 7
>3 7 1 8
>
>see how the total for row 1 becomes amount for year 2/
Sounds like LAG() is what you're after? Gives you access to values in 'previous' rows.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions56a.htm#SQLRF00652
-- Andy Hassall (andy@andyh.co.uk) icq(5747695) http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space | disk usage analysis toolReceived on Mon Jan 13 2003 - 16:13:08 CST
![]() |
![]() |