597
597
The elements of the <literal>PARTITION BY</> list are interpreted in
598
the same fashion as elements of a
599
<xref linkend="sql-groupby" endterm="sql-groupby-title">, and
600
the elements of the <literal>ORDER BY</> list are interpreted in the
601
same fashion as elements of an
602
<xref linkend="sql-orderby" endterm="sql-orderby-title">.
603
The only difference is that these expressions can contain aggregate
598
much the same fashion as elements of a
599
<xref linkend="sql-groupby" endterm="sql-groupby-title">, except that
600
they are always simple expressions and never the name or number of an
602
Another difference is that these expressions can contain aggregate
604
603
function calls, which are not allowed in a regular <literal>GROUP BY</>
605
604
clause. They are allowed here because windowing occurs after grouping
609
Similarly, the elements of the <literal>ORDER BY</> list are interpreted
610
in much the same fashion as elements of an
611
<xref linkend="sql-orderby" endterm="sql-orderby-title">, except that
612
the expressions are always taken as simple expressions and never the name
613
or number of an output column.
610
617
The optional <replaceable class="parameter">frame_clause</> defines
611
618
the <firstterm>window frame</> for window functions that depend on the
612
619
frame (not all do). It can be one of