Hi John,
LEAD and LAG are just shortcuts for a basic OLAP function:
select id, yr, value,
min(yr)
over (partition by id
order by yr
rows between 1 following and 1 following) as next_yr, -- Oracle's LAG
min(value)
over (partition by id
order by yr.
rows between 1 following and 1 following) as next_value
from test1
qualify next_value is not null -- not the last row
order by id, yr
Dieter
Hi John,
LEAD and LAG are just shortcuts for a basic OLAP function:
Dieter