Comments - Window Frames
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
The current row and the following row:
SELECT name, test, score, SUM(score) OVER (ORDER BY score ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS total_score FROM student_test ORDER BY score; +---------+--------+-------+-------------+
+---------+--------+-------+-------------+
+---------+--------+-------+-------------+
`The current row and the following row:` the descrption may be wrong. or chang the sql 'ORDER BY score ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING' to `ORDER BY score ROWS BETWEEN 0 PRECEDING AND 1 FOLLOWING`