Some SQL databases have a window function called NTH_VALUE()
that allows us to get a value from a given row in the window frame, based on the row number.
More specifically, the function returns the value of a given expression from the from the N-th row of the window frame, where N is a number that we specify when calling the function.
Continue reading