- 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;