Skip to content

1308. Running Total for Different Genders

1
2
3
4
5
6
7
8
9
SELECT
  gender,
  day,
  SUM(score_points) OVER(
    PARTITION BY gender
    ORDER BY day
  ) AS total
FROM Scores
ORDER BY 1, 2;