3 ms·
Nice writeup, though I would have liked some examples using "partition by". The main gotcha I recall -- and it's somewhat confusing the first time you run acros
by msluyter 12y ago
Nice writeup, though I would have liked some examples using "partition by". The main gotcha I recall -- and it's somewhat confusing the first time you run across it -- is that things like last_row() don't work as expected without the magic incantation:
over (partition by foo order by blah BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
This forces the query to evaluate the function over the entire partition, rather then just over the current window. The article does mention this point, but it bears re-iteration.