r/SQL • • Oct 20 '26

MySQL COUNT() vs COUNT() OVER()

Post image

I've found this query as a solution to the famous Pizza Runner case study, and I am stuck at figuring out what COUNT() returns, compared to COUNT() OVER().

I know OVER() does the count (or whatever aggregation) over the entire dataset, but idk I'm just not getting the percentage part of this query.

Help :)

29 Upvotes

17 comments sorted by

View all comments

Show parent comment

3

u/RandumbNumber Oct 21 '26

Not sure if you’re kidding or not, but this is exactly what I thought, until I read the comments and released it’s not volume but percentage. So either really poorly phrased question, or a wrong answer.
I’ve never seen volume interpreted the way it is here.