Question : How to calculate the difference of values in consecutive rows

HI
I have a table in oracle 10.2 with the following structure
"ID_EMP" number,
"ID_OFI" number,
"COD_CUENTA" varchar,
"FEC_CORTE" date,
"FEC_FIN_MES" date,
"FEC_FIN_AÑO" date,
"SALDO" number
this is a sample of the rows
1      255      1000000000      01-JAN-2005      31-JAN-2005      31-DEC-2005      24377161.83
1      255      1000000000      03-JAN-2005      31-JAN-2005      31-DEC-2005      24473060.42
1      255      1000000000      04-JAN-2005      31-JAN-2005      31-DEC-2005      24663020.54
1      255      1000000000      05-JAN-2005      31-JAN-2005      31-DEC-2005      24622068.1
1      255      1000000000      06-JAN-2005      31-JAN-2005      31-DEC-2005      24623397.32
1      255      1000000000      07-JAN-2005      31-JAN-2005      31-DEC-2005      24648727.39
I need to calculate the difference of values between rows
for example
1      255      1000000000      01-JAN-2005      31-JAN-2005      31-DEC-2005      24377161.83 (24377161.83-0)
1      255      1000000000      03-JAN-2005      31-JAN-2005      31-DEC-2005      24473060.42 (24473060.42-24377161.83)
1      255      1000000000      04-JAN-2005      31-JAN-2005      31-DEC-2005      24663020.54 (24663020.54-24473060.42)
and so on

I can help with the script please!!!

Answer : How to calculate the difference of values in consecutive rows

OOPS.. I must be really sleepy.. To sum it up:

You have to use addcslashes - note the C in between. In this function, you can give the list of characters to be escaped.
So, addcslashes($str, "\x00\n\r\'\"\x1a"); is equivalent to  mysql_real_escape_string($str); since the latter escapes only the characters listed in the former.
Here is the correct link: http://www.php.net/manual/en/function.addcslashes.php
Random Solutions  
 
programming4us programming4us