window_funcs icon indicating copy to clipboard operation
window_funcs copied to clipboard

Minor issue with Correct Running Total Exercise

Open dmcmurchy opened this issue 2 years ago • 0 comments

First off - thank you very much for putting this together as I've found it very useful and informative on my SQL data analyst journey.

From: http://www.windowfunctions.com/questions/over/3 The question states to Order by: weight desc

If taken as the column weight; the results won't appear in the correct order in the output. Oscar and Smokey will swap positions as will the running_total_weight values 12.2 and 6.1 (in that order).

It becomes obvious after seeing the answer that the challenger should order by running_total_weight after the FROM.

dmcmurchy avatar Apr 25 '23 22:04 dmcmurchy