Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit82eafab

Browse files
committed
Improve docs about using ORDER BY to control aggregate input order.
David Johnston pointed out that the original text here had been obsoletedby SQL:2008, which allowed ORDER BY in subqueries. We could weaken thetext to describe ORDER-BY-in-subqueries as an optional SQL feature that'spossibly unportable; but then the exact same statements would apply tothe alternative it's being compared to (ORDER-BY-in-aggregate-calls).So really that would be pretty useless; let's just take out the sentenceentirely. Instead, point out the hazard that any extra processing in theupper query might cause the subquery output order to be destroyed.Discussion: <CAKFQuwbAX=iO9QbpN7_jr+BnUWm9FYX8WbEPUvG0p+nZhp6TZg@mail.gmail.com>
1 parent50e5315 commit82eafab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13102,8 +13102,9 @@ SELECT count(*) FROM sometable;
1310213102
SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1310313103
]]></screen>
1310413104

13105-
But this syntax is not allowed in the SQL standard, and is
13106-
not portable to other database systems.
13105+
Beware that this approach can fail if the outer query level contains
13106+
additional processing, such as a join, because that might cause the
13107+
subquery's output to be reordered before the aggregate is computed.
1310713108
</para>
1310813109

1310913110
<para>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp