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

Commitb997a4b

Browse files
committed
> Great! Please cc: the docs or hackers mailing lists to make sure the
> patches are not lost...Aggregate doc patches:The patches are attached. Be great if you could check them over to makesure all relevant content (and markup) is there...Isaac Wilcox
1 parentbfdb695 commitb997a4b

File tree

3 files changed

+85
-4
lines changed

3 files changed

+85
-4
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,87 @@ Not defined by this name. Implements the intersection operator '#'
15151515

15161516
</sect1>
15171517

1518+
<sect1>
1519+
1520+
<title id="aggregate-funcs">Aggregate Functions</title>
1521+
1522+
<note>
1523+
<title>Author</title>
1524+
<para>
1525+
Written by <ulink url="mailto:isaac@azartmedia.com">Isaac Wilcox</ulink>
1526+
on 2000-06-16.
1527+
</para>
1528+
</note>
1529+
1530+
<para>
1531+
<firstterm>Aggregate functions</firstterm> allow the generation of simple
1532+
statistics about the values of particular columns over the selected set
1533+
of rows. See also <xref linkend="sql" endterm="aggregates-tutorial"> and
1534+
<xref linkend="syntax" endterm="aggregates-syntax">.
1535+
</para>
1536+
1537+
<para>
1538+
<table tocentry="1">
1539+
<title>Aggregate Functions</title>
1540+
<tgroup cols="4">
1541+
<thead>
1542+
<row>
1543+
<entry>Function</entry>
1544+
<entry>Returns</entry>
1545+
<entry>Description</entry>
1546+
<entry>Example</entry>
1547+
<entry>Notes</entry>
1548+
</row>
1549+
</thead>
1550+
<tbody>
1551+
<row>
1552+
<entry>COUNT(*)</entry>
1553+
<entry>int4</entry>
1554+
<entry>Counts the selected rows.</entry>
1555+
<entry>COUNT(*)</entry>
1556+
<entry></entry>
1557+
</row>
1558+
<row>
1559+
<entry>COUNT(<replaceable class="parameter">column-name</replaceable>)</entry>
1560+
<entry>int4</entry>
1561+
<entry>Counts the selected rows for which the value of <replaceable class="parameter">column-name</replaceable> is not NULL.</entry>
1562+
<entry>COUNT(age)</entry>
1563+
<entry></entry>
1564+
</row>
1565+
<row>
1566+
<entry>SUM(<replaceable class="parameter">column-name</replaceable>)</entry>
1567+
<entry>Same as the data type of the column being summed.</entry>
1568+
<entry>Finds the total obtained by adding the values of <replaceable class="parameter">column-name</replaceable> across all selected rows.</entry>
1569+
<entry>SUM(hours)</entry>
1570+
<entry>Summation is supported on the following data types: int8, int4, int2, float4, float8, money, interval, numeric</entry>
1571+
</row>
1572+
<row>
1573+
<entry>MAX(<replaceable class="parameter">column-name</replaceable>)</entry>
1574+
<entry>Same as the data type of the column whose maximum value is sought.</entry>
1575+
<entry>The maximum value of <replaceable class="parameter">column-name</replaceable> across all selected rows.</entry>
1576+
<entry>MAX(age)</entry>
1577+
<entry>Finding the maximum value is supported on the following data types: int8, int4, int2, float4, float8, date, time, timetz, money, timestamp, interval, text, numeric.</entry>
1578+
</row>
1579+
<row>
1580+
<entry>MIN(<replaceable class="parameter">column-name</replaceable>)</entry>
1581+
<entry>same as the data type of the column whose minimum value is sought.</entry>
1582+
<entry>The minimum value of <replaceable class="parameter">column-name</replaceable> across all selected rows.</entry>
1583+
<entry>MIN(age)</entry>
1584+
<entry>Finding the minimum value is supported on the following data types: int8, int4, int2, float4, float8, date, time, timetz, money, timestamp, interval, text, numeric.</entry>
1585+
</row>
1586+
<row>
1587+
<entry>AVG(<replaceable class="parameter">column-name</replaceable>)</entry>
1588+
<entry>Same as the data type of the column being averaged.</entry>
1589+
<entry>The average (mean) of the values in the given column across all selected rows.</entry>
1590+
<entry>AVG(age)</entry>
1591+
<entry>Finding the mean value is supported on the following data types: int8, int4, int2, float4, float8, money, interval, numeric. Note that as the return type is the same as that of the data being averaged, using AVG() on discrete data will give a rounded result.</entry>
1592+
</row>
1593+
</tbody>
1594+
</tgroup>
1595+
</table>
1596+
</para>
1597+
</sect1>
1598+
15181599
</chapter>
15191600

15201601
<!-- Keep this comment at the end of the file

‎doc/src/sgml/sql.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.10 2000/06/14 13:10:48 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.11 2000/06/20 18:04:18 momjian Exp $
33
-->
44

55
<chapter id="sql">
@@ -1032,7 +1032,7 @@ SELECT S.SNAME, P.PNAME
10321032
</sect3>
10331033

10341034
<sect3>
1035-
<title>Aggregate Operators</title>
1035+
<title id="aggregates-tutorial">Aggregate Operators</title>
10361036

10371037
<para>
10381038
<acronym>SQL</acronym> provides aggregate operators

‎doc/src/sgml/syntax.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.21 2000/06/09 01:43:56 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.22 2000/06/20 18:04:18 momjian Exp $
33
-->
44

55
<chapter id="syntax">
@@ -747,7 +747,7 @@ sqrt(emp.salary)
747747
</sect2>
748748

749749
<sect2>
750-
<title>Aggregate Expressions</title>
750+
<title id="aggregates-syntax">Aggregate Expressions</title>
751751

752752
<para>
753753
An <firstterm>aggregate expression</firstterm> represents the application

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp