From: Bruce Momjian Date: Sun, 20 Feb 2011 05:01:08 +0000 (-0500) Subject: Adjust documentation wording of window function ORDER BY to not mention X-Git-Tag: REL9_1_ALPHA4~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5813488a4ccc78ec3a4ad0d5da4e6e844af75e8;p=postgresql Adjust documentation wording of window function ORDER BY to not mention avg() because it was inaccurate. --- diff --git a/doc/src/sgml/advanced.sgml b/doc/src/sgml/advanced.sgml index 11859b4e30..218988e0af 100644 --- a/doc/src/sgml/advanced.sgml +++ b/doc/src/sgml/advanced.sgml @@ -383,10 +383,10 @@ SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM emps - Although avg will produce the same result no matter - what order it processes the partition's rows in, this is not true of all - window functions. When needed, you can control that order using - ORDER BY within OVER. Here is an example: + You can also control the order in which rows are processed by + window functions using ORDER BY within OVER. + (The window ORDER BY does not even have to match the + order in which the rows are output.) Here is an example: SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary DESC) FROM empsalary;