$ 0 0 LAG/LEAD is just a short-cut: LAG(col,x,val) OVER (ORDER BY col2) = COALESCE(MIN(col) OVER (ORDER BY col2 ROWS BETWEEN x PRECEDING AND x PRECEDING) , val)For LEAD replace PRECEDING with FOLLOWING. Dieter
LAG/LEAD is just a short-cut:
For LEAD replace PRECEDING with FOLLOWING.
Dieter