Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
21076076
Commit
21076076
authored
Sep 01, 2010
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify documentation of handling of null arguments for aggregates.
Per discussion.
parent
4ff6856c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+2
-2
doc/src/sgml/syntax.sgml
doc/src/sgml/syntax.sgml
+16
-10
No files found.
doc/src/sgml/func.sgml
View file @
21076076
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.53
0 2010/08/24 06:30:43 itagaki
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.53
1 2010/09/01 18:22:29 tgl
Exp $ -->
<chapter
id=
"functions"
>
<chapter
id=
"functions"
>
<title>
Functions and Operators
</title>
<title>
Functions and Operators
</title>
...
@@ -10034,7 +10034,7 @@ SELECT NULLIF(value, '(none)') ...
...
@@ -10034,7 +10034,7 @@ SELECT NULLIF(value, '(none)') ...
<entry>
<entry>
array of the argument type
array of the argument type
</entry>
</entry>
<entry>
input values concatenated into an array
</entry>
<entry>
input values
, including nulls,
concatenated into an array
</entry>
</row>
</row>
<row>
<row>
...
...
doc/src/sgml/syntax.sgml
View file @
21076076
<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.15
3 2010/08/13 01:12:38 rhaas
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.15
4 2010/09/01 18:22:29 tgl
Exp $ -->
<chapter id="sql-syntax">
<chapter id="sql-syntax">
<title>SQL Syntax</title>
<title>SQL Syntax</title>
...
@@ -1541,23 +1541,29 @@ sqrt(2)
...
@@ -1541,23 +1541,29 @@ sqrt(2)
<para>
<para>
The first form of aggregate expression invokes the aggregate
The first form of aggregate expression invokes the aggregate
across all input rows for which the given expression(s) yield
once for each input row.
non-null values. (Actually, it is up to the aggregate function
whether to ignore null values or not — but all the standard ones do.)
The second form is the same as the first, since
The second form is the same as the first, since
<literal>ALL</literal> is the default.
The third form invokes the
<literal>ALL</literal> is the default.
aggregate for all distinct values of the expressions found
The third form invokes the aggregate once for each distinct value
in the input rows (ignoring nulls if the function chooses to do so).
of the expression (or distinct set of values, for multiple expressions)
The last form invokes the aggregate once for
found in the input rows.
each input row regardless of null or non-null values
; since no
The last form invokes the aggregate once for each input row
; since no
particular input value is specified, it is generally only useful
particular input value is specified, it is generally only useful
for the <function>count(*)</function> aggregate function.
for the <function>count(*)</function> aggregate function.
</para>
</para>
<para>
Most aggregate functions ignore null inputs, so that rows in which
one or more of the expression(s) yield null are discarded. This
can be assumed to be true, unless otherwise specified, for all
built-in aggregates.
</para>
<para>
<para>
For example, <literal>count(*)</literal> yields the total number
For example, <literal>count(*)</literal> yields the total number
of input rows; <literal>count(f1)</literal> yields the number of
of input rows; <literal>count(f1)</literal> yields the number of
input rows in which <literal>f1</literal> is non-null;
input rows in which <literal>f1</literal> is non-null, since
<function>count</> ignores nulls; and
<literal>count(distinct f1)</literal> yields the number of
<literal>count(distinct f1)</literal> yields the number of
distinct non-null values of <literal>f1</literal>.
distinct non-null values of <literal>f1</literal>.
</para>
</para>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment