Ver Mensaje Individual
  #5  
Antiguo 16-12-2011
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Restingiéndome a tu consulta inicial, y tratándose de MySQL, yo haría algo así:

Código SQL [-]
set @anterior=0;
select *, importe - @anterior, @anterior:=importe
from tabla

// Saludos
Responder Con Cita