3 ms·
Lovely website, I'm finally learning about window functions as I do this. Thanks a bunch. One question / bug report? Q7 rejects this: select name, weight, we
by nothrabannosir 9y ago
Lovely website, I'm finally learning about window functions as I do this. Thanks a bunch.
One question / bug report? Q7 rejects this:
select
name, weight, weight - (min(weight) over (order by weight asc rows between 1 preceding and current row) ) as weight_to_lose
from cats
is that much worse than lag() or is it just non-idiomatic?
(edit: and Q10 asks about "window", but it was quite hard to google. if you could provide another one of those links to the relevant docs, that could help a bunch :D)
- andy_boot 9y agoThat query looks fine to me, I'll tweak the code. Yep I need to fix up Q10 a bit.