We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent8c0f1e2 commitd581348Copy full SHA for d581348
doc/src/sgml/advanced.sgml
@@ -383,10 +383,10 @@ SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM emps
383
</para>
384
385
<para>
386
-Although <function>avg</> will produce thesame result no matter
387
-what order it processes the partition's rows in, this is not true of all
388
- windowfunctions. When needed, you can control that order using
389
-<literal>ORDER BY</> within <literal>OVER</>. Here is an example:
+You can also control theorder in which rows are processed by
+window functions using <literal>ORDER BY</> within <literal>OVER</>.
+(Thewindow<literal>ORDER BY</> does not even have to match the
+order in which the rows are output.) Here is an example:
390
391
<programlisting>
392
SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary DESC) FROM empsalary;