Home » SQL & PL/SQL » SQL & PL/SQL » Calculate differences of previous values
icon7.gif  Calculate differences of previous values [message #253377] Mon, 23 July 2007 11:52 Go to next message
pmood@charter.net
Messages: 3
Registered: April 2007
Location: Missouri, USA
Junior Member
Can anyone provide a solution to my problem.
I need a statement that would calculate the difference between the previous value and the current value (see example)

date value
1/02/07 313
1/17/07 311
3/23/07 286
4/13/07 284

on 1/17 (313 - 311)
on 3/23 (311 - 286)
on 4/13 (286 - 284)
Re: Calculate differences of previous values [message #253378 is a reply to message #253377] Mon, 23 July 2007 12:02 Go to previous message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at LAG function.

Regards
Michel
Previous Topic: ORA-12801
Next Topic: How to correct ORA-01830: date format picture ends before converting entire input string error?
Goto Forum:
  


Current Time: Wed Dec 07 03:19:51 CST 2016

Total time taken to generate the page: 0.14644 seconds