|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.458 2008/11/1315:59:50 petere Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.459 2008/11/1323:01:09 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="functions">
|
4 | 4 | <title>Functions and Operators</title>
|
@@ -8387,8 +8387,8 @@ SELECT xmlagg(x) FROM test;
|
8387 | 8387 | </para>
|
8388 | 8388 |
|
8389 | 8389 | <para>
|
8390 |
| -The influence the order of the concatenation, something like the |
8391 |
| - following approachto sort the input valuescan be used: |
| 8390 | +To determine the order of the concatenation, something like the |
| 8391 | + following approach can be used: |
8392 | 8392 |
|
8393 | 8393 | <screen><![CDATA[
|
8394 | 8394 | SELECT xmlagg(x) FROM (SELECT * FROM test ORDER BY y DESC) AS tab;
|
@@ -9772,19 +9772,19 @@ SELECT count(*) FROM sometable;
|
9772 | 9772 | and <function>xmlagg</function>, as well as similar user-defined
|
9773 | 9773 | aggregate functions, produce meaningfully different result values
|
9774 | 9774 | depending on the order of the input values. In the current
|
9775 |
| - implementation, the order of theconcatenation is in principle |
9776 |
| -undefined. Makingthe input valuesto be sortedin some other way |
| 9775 | + implementation, the order of theinput is in principle unspecified. |
| 9776 | +Supplyingthe input valuesfrom a sortedsubquery |
9777 | 9777 | will usually work, however. For example:
|
9778 | 9778 |
|
9779 | 9779 | <screen><![CDATA[
|
9780 |
| -SELECT xmlagg(x) FROM (SELECT* FROM test ORDER BY y DESC) AS tab; |
| 9780 | +SELECT xmlagg(x) FROM (SELECTx FROM test ORDER BY y DESC) AS tab; |
9781 | 9781 | ]]></screen>
|
9782 | 9782 |
|
9783 |
| - But thisapproach is notguaranteed to workinall situations, and |
9784 |
| -it is not strictly SQL-conforming. A future version of PostgreSQL |
9785 |
| - might provide an additional feature to control the order in a |
9786 |
| - better-defined way (<literal>xmlagg(expr ORDER BY expr, expr, |
9787 |
| - ...</literal>). |
| 9783 | + But thissyntax is notallowedinthe SQL standard, and is |
| 9784 | +not portable to other database systems. A future version of |
| 9785 | +<productname>PostgreSQL</>might provide an additional feature to control |
| 9786 | +the order in abetter-defined way (<literal>xmlagg(expr ORDER BY expr, expr, |
| 9787 | + ...)</literal>). |
9788 | 9788 | </para>
|
9789 | 9789 |
|
9790 | 9790 | <para>
|
|