Repeat last known value
ETL SQL Window functionsDemo scripts below.
Disclaimer: This technique is by no means something I have come up with, I’ve just needed it enough times that I figured I might as well put it into my own words, for future reference.
Background
Suppose you have a collection of time series data, recording some status or other measurement at a point in time.
In an OLTP system we probably don’t want to repeat the same value every time we take a measurement, or we may only record changes made to a ledger when they occur.
Read more...