Comments - Window Functions Overview
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.
It's not (yet) mentioned on this page, but you can actually also use NAMED windows, just as you can in MySQL. e.g. The following are allowed:
SELECT pk, c, count(*) over win1 FROM table1 WINDOW win1 AS (PARTITION by c ORDER by pk);
or use the named window with adjustments applied:
SELECT pk, c, count(*) over (win1 ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) FROM table1 WINDOW win1 AS (PARTITION by c ORDER by pk);
or define a succession of named windows, optionally based on preceding ones:
SELECT pk, c, count(*) over (win2 ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) FROM table1 WINDOW win1 AS (PARTITION by c), win2 AS (win1 ORDER by pk);