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

Commit3c9d398

Browse files
committed
Doc: improve index entry for "median".
We had an index entry for "median" attached to the percentile_cont functionentry, which was pretty useless because a person following the link wouldnever realize that that function was the one they were being hinted to use.Instead, make the index entry point at the example in syntax-aggregates,and add a <seealso> link to "percentile".Also, since that example explicitly claims to be calculating the median,make it use percentile_cont not percentile_disc. This makes no differencein terms of the larger goals of that section, but so far as I can find,nearly everyone thinks that "median" means the continuous not discretecalculation.Per gripe from Steven Winfield. Back-patch to 9.4 where we introducedpercentile_cont.Discussion:https://postgr.es/m/20161223102056.25614.1166@wrigleys.postgresql.org
1 parentff33d14 commit3c9d398

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13774,9 +13774,6 @@ SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;
1377413774
<primary>percentile</primary>
1377513775
<secondary>continuous</secondary>
1377613776
</indexterm>
13777-
<indexterm>
13778-
<primary>median</primary>
13779-
</indexterm>
1378013777
<function>percentile_cont(<replaceable class="parameter">fraction</replaceable>) WITHIN GROUP (ORDER BY <replaceable class="parameter">sort_expression</replaceable>)</function>
1378113778
</entry>
1378213779
<entry>

‎doc/src/sgml/syntax.sgml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,11 +1694,21 @@ SELECT string_agg(a ORDER BY a, ',') FROM table; -- incorrect
16941694
case, write just <literal>()</> not <literal>(*)</>.
16951695
(<productname>PostgreSQL</> will actually accept either spelling, but
16961696
only the first way conforms to the SQL standard.)
1697+
</para>
1698+
1699+
<para>
1700+
<indexterm>
1701+
<primary>median</primary>
1702+
</indexterm>
1703+
<indexterm>
1704+
<primary>median</primary>
1705+
<seealso>percentile</seealso>
1706+
</indexterm>
16971707
An example of an ordered-set aggregate call is:
16981708

16991709
<programlisting>
1700-
SELECTpercentile_disc(0.5) WITHIN GROUP (ORDER BY income) FROM households;
1701-
percentile_disc
1710+
SELECTpercentile_cont(0.5) WITHIN GROUP (ORDER BY income) FROM households;
1711+
percentile_cont
17021712
-----------------
17031713
50489
17041714
</programlisting>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp