题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
--解决方案(1) SELECTs1.gender, s1.day, SUM(s2.score_points) AStotalFROMScoresASs1, ScoresASs2WHEREs1.gender=s2.genderANDs1.day>=s2.dayGROUPBYs1.gender, s1.dayORDERBYs1.gender, s1.day; --解决方案(2) SELECTgender, day, SUM(score_points) OVERwAStotalFROMScoresWINDOWwAS (PARTITIONBYgenderORDERBYday); --解决方案(3) SELECTgender, day, SUM(score_points) OVER(PARTITIONBYgenderORDERBYgender, day) totalFROMScores