Try this:

select t.name, t.data, coalesce(t.data -(select data from t1 d where d.id =
t.id -1),0) from t1 t


--
regards,
Michał Kurczabiński

Reply via email to