$ 0 0 select coalesce(min(col_2) over (partition by col_1 order by col_2 rows between 1 preceding and 1 preceding), 0) Dieter