Again, without a subquery :
The key element is adding PARTITION BY to the window functions:
SELECT DISTINCT t.section
→ sqlfiddle
Here you are GROUP BY t.attendee_id, t.section , before you run the result through the window function. And use PARTITION BY t.section in the window function, since you want this time the results to be partitioned.
Uncomment the second line if you want a ticket score.
Otherwise, it works similarly to my answer to your previous question . Ie, the rest of the explanation applies.
source share