pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: PostgreSQL aggregate function documentation
4+ messages / 3 participants
[nested] [flat]
* Re: PostgreSQL aggregate function documentation
@ 2000-06-13 13:20 Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-16 00:10 ` Re: PostgreSQL aggregate function documentation Isaac Wilcox <iwilcox@tirin.openworld.co.uk>
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Lockhart @ 2000-06-13 13:20 UTC (permalink / raw)
To: Isaac Wilcox <iwilcox@tirin.openworld.co.uk>; +Cc: Hackers List <pgsql-hackers@postgresql.org>
> OK, if you don't tell me that someone is already planning to do it,
> and if I can glean the info I need from the source, then I'll attempt
> to write some docs on what aggregates are supported and how to use
> them, and mail them to you.
Great! Please cc: the docs or hackers mailing lists to make sure the
patches are not lost; I've been coping with a new Linux distro which
uses different mail tools that I'm used to :(
Look in doc/src/sgml/ for the doc source code. If the sgml markup is
confusing, just put in the text or send the text to be included and I'll
mark it up for you.
- Thomas
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PostgreSQL aggregate function documentation
2000-06-13 13:20 Re: PostgreSQL aggregate function documentation Thomas Lockhart <lockhart@alumni.caltech.edu>
@ 2000-06-16 00:10 ` Isaac Wilcox <iwilcox@tirin.openworld.co.uk>
2000-06-16 07:13 ` Re: PostgreSQL aggregate function documentation Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-20 18:03 ` Re: Re: PostgreSQL aggregate function documentation Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 2 replies; 4+ messages in thread
From: Isaac Wilcox @ 2000-06-16 00:10 UTC (permalink / raw)
To: Thomas Lockhart <lockhart@alumni.caltech.edu>; +Cc: pgsql-docs
> > OK, if you don't tell me that someone is already planning to do it,
> > and if I can glean the info I need from the source, then I'll attempt
> > to write some docs on what aggregates are supported and how to use
> > them, and mail them to you.
>
> Great! Please cc: the docs or hackers mailing lists to make sure the
> patches are not lost...
[snip]
The patches are attached. Be great if you could check them over to make sure
all relevant content (and markup) is there...
There are three patches - one for sql.sgml (tutorial), one for syntax.sgml
(user) and the main one for func.sgml (user).
Isaac.
:)
Attachments:
sql.sgml.udiff (text/plain, 360B) download
--- /usr/local/postgresql-7.0.2/doc/src/sgml/sql.sgml Tue May 2 21:01:52 2000
+++ sql.sgml Fri Jun 16 00:37:24 2000
@@ -1021,7 +1021,7 @@
</sect3>
<sect3>
- <title>Aggregate Operators</title>
+ <title id="aggregates-tutorial">Aggregate Operators</title>
<para>
<acronym>SQL</acronym> provides aggregate operators
syntax.sgml.udiff (text/plain, 382B) download
--- /usr/local/postgresql-7.0.2/doc/src/sgml/syntax.sgml Tue May 2 21:01:53 2000
+++ syntax.sgml Fri Jun 16 00:35:49 2000
@@ -747,7 +747,7 @@
</sect2>
<sect2>
- <title>Aggregate Expressions</title>
+ <title id="aggregates-syntax">Aggregate Expressions</title>
<para>
An <firstterm>aggregate expression</firstterm> represents the application
func.sgml.udiff (text/plain, 4.0K) download
--- /usr/local/postgresql-7.0.2/doc/src/sgml/func.sgml Mon May 15 02:41:18 2000
+++ func.sgml Fri Jun 16 00:46:29 2000
@@ -1515,6 +1515,87 @@
</sect1>
+ <sect1>
+
+ <title id="aggregate-funcs">Aggregate Functions</title>
+
+ <note>
+ <title>Author</title>
+ <para>
+ Written by <ulink url="mailto:isaac@azartmedia.com">Isaac Wilcox</ulink>
+ on 2000-06-16.
+ </para>
+ </note>
+
+ <para>
+ <firstterm>Aggregate functions</firstterm> allow the generation of simple
+ statistics about the values of particular columns over the selected set
+ of rows. See also <xref linkend="sql" endterm="aggregates-tutorial"> and
+ <xref linkend="syntax" endterm="aggregates-syntax">.
+ </para>
+
+ <para>
+ <table tocentry="1">
+ <title>Aggregate Functions</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Function</entry>
+ <entry>Returns</entry>
+ <entry>Description</entry>
+ <entry>Example</entry>
+ <entry>Notes</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>COUNT(*)</entry>
+ <entry>int4</entry>
+ <entry>Counts the selected rows.</entry>
+ <entry>COUNT(*)</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>COUNT(<replaceable class="parameter">column-name</replaceable>)</entry>
+ <entry>int4</entry>
+ <entry>Counts the selected rows for which the value of <replaceable class="parameter">column-name</replaceable> is not NULL.</entry>
+ <entry>COUNT(age)</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>SUM(<replaceable class="parameter">column-name</replaceable>)</entry>
+ <entry>Same as the data type of the column being summed.</entry>
+ <entry>Finds the total obtained by adding the values of <replaceable class="parameter">column-name</replaceable> across all selected rows.</entry>
+ <entry>SUM(hours)</entry>
+ <entry>Summation is supported on the following data types: int8, int4, int2, float4, float8, money, interval, numeric</entry>
+ </row>
+ <row>
+ <entry>MAX(<replaceable class="parameter">column-name</replaceable>)</entry>
+ <entry>Same as the data type of the column whose maximum value is sought.</entry>
+ <entry>The maximum value of <replaceable class="parameter">column-name</replaceable> across all selected rows.</entry>
+ <entry>MAX(age)</entry>
+ <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>
+ </row>
+ <row>
+ <entry>MIN(<replaceable class="parameter">column-name</replaceable>)</entry>
+ <entry>same as the data type of the column whose minimum value is sought.</entry>
+ <entry>The minimum value of <replaceable class="parameter">column-name</replaceable> across all selected rows.</entry>
+ <entry>MIN(age)</entry>
+ <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>
+ </row>
+ <row>
+ <entry>AVG(<replaceable class="parameter">column-name</replaceable>)</entry>
+ <entry>Same as the data type of the column being averaged.</entry>
+ <entry>The average (mean) of the values in the given column across all selected rows.</entry>
+ <entry>AVG(age)</entry>
+ <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>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ </sect1>
+
</chapter>
<!-- Keep this comment at the end of the file
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PostgreSQL aggregate function documentation
2000-06-13 13:20 Re: PostgreSQL aggregate function documentation Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-16 00:10 ` Re: PostgreSQL aggregate function documentation Isaac Wilcox <iwilcox@tirin.openworld.co.uk>
@ 2000-06-16 07:13 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Lockhart @ 2000-06-16 07:13 UTC (permalink / raw)
To: Isaac Wilcox <iwilcox@tirin.openworld.co.uk>; +Cc: pgsql-docs
> There are three patches - one for sql.sgml (tutorial), one for
> syntax.sgml (user) and the main one for func.sgml (user).
Thanks Isaac!
- Thomas
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Re: PostgreSQL aggregate function documentation
2000-06-13 13:20 Re: PostgreSQL aggregate function documentation Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-16 00:10 ` Re: PostgreSQL aggregate function documentation Isaac Wilcox <iwilcox@tirin.openworld.co.uk>
@ 2000-06-20 18:03 ` Bruce Momjian <pgman@candle.pha.pa.us>
1 sibling, 0 replies; 4+ messages in thread
From: Bruce Momjian @ 2000-06-20 18:03 UTC (permalink / raw)
To: Isaac Wilcox <iwilcox@tirin.openworld.co.uk>; +Cc: Thomas Lockhart <lockhart@alumni.caltech.edu>; pgsql-docs
Applied. Thanks.
> > > OK, if you don't tell me that someone is already planning to do it,
> > > and if I can glean the info I need from the source, then I'll attempt
> > > to write some docs on what aggregates are supported and how to use
> > > them, and mail them to you.
> >
> > Great! Please cc: the docs or hackers mailing lists to make sure the
> > patches are not lost...
>
> [snip]
>
> The patches are attached. Be great if you could check them over to make sure
> all relevant content (and markup) is there...
>
> There are three patches - one for sql.sgml (tutorial), one for syntax.sgml
> (user) and the main one for func.sgml (user).
>
> Isaac.
>
> :)
Content-Description: Patch to docs/src/sgml/sql.sgml
[ Attachment, skipping... ]
Content-Description: Patch to docs/src/sgml/syntax.sgml
[ Attachment, skipping... ]
Content-Description: Patch to docs/src/sgml/func.sgml
[ Attachment, skipping... ]
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2000-06-20 18:03 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-06-13 13:20 Re: PostgreSQL aggregate function documentation Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-16 00:10 ` Isaac Wilcox <iwilcox@tirin.openworld.co.uk>
2000-06-16 07:13 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-20 18:03 ` Bruce Momjian <pgman@candle.pha.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox