यह आपकी (कुछ हद तक) मदद कर सकता है।
select a.id, a.length,
coalesce(a.length -
(select b.length from foo b where b.id = a.id + 1), a.length) as diff
from foo a
यह आपकी (कुछ हद तक) मदद कर सकता है।
select a.id, a.length,
coalesce(a.length -
(select b.length from foo b where b.id = a.id + 1), a.length) as diff
from foo a