#12
SQL
Looking Back and Forward: LAG() and LEAD() in SQL
Most window functions look at the current row and summarise its neighbours. LAG() and LEAD() do something more direct: they reach out and grab a value...
#14 SQLFIRST_VALUE, LAST_VALUE, and NTH_VALUE: Reading Values by Position
Sometimes you don't want to compute a value across a window, you want to reach in and grab one from a specific position: the first row, the last row, ...