4 ms·
I'm stuck on the first question. I'm not sure why this is wrong. Can anyone help me? > select name, sum(weight) OVER (PARTITION BY name) as running_total_weigh
by picardo 9y ago
I'm stuck on the first question. I'm not sure why this is wrong. Can anyone help me?
> select name, sum(weight) OVER (PARTITION BY name) as running_total_weight from cats order by name
http://www.windowfunctions.com/questions/1 http://www.windowfunctions.com/questions/1
- papercrane 9y agoIt's asking for a running total of all weights, so you shouldn't partition by name. Use an ORDER BY instead of PARTITION BY.
- picardo 9y agoAh, I get it. Thanks!