Popular Posts

SQLblog.com - The SQL Server blog spot on the web

Thursday, September 28, 2017

Window Function Lag() - No previous Value when 1 row.

SQLServerCentral » Latest topics
Window Function Lag() - No previous Value when 1 row.
Hi,

LAG function gives us value which was encountered in previous line.
There is no lag value available for 1 row, and 0 (zero) is returned. Is it possible/Is there a way to return the current value (instead of previous) in this case?

No comments: