Re: 4.2.7. Aggregate Expressions

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: y(dot)saburov(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: 4.2.7. Aggregate Expressions
Date: 2026-09-15 21:28:31
Message-ID: aqm4f5EZUdcSKh1C@momjian.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thu, Aug 27, 2026 at 02:26:46PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/18/sql-expressions.html
> Description:
>
> Can you add a code block with an example?
>
> Perhaps something like this:
>
> ```psql
> db=# WITH vals (f1) AS ( VALUES (1),(3),(4),(3),(2),(null) )
> SELECT count(*), count(f1), COUNT(DISTINCT f1) FROM vals;
>
> count | count | count
> -------+-------+-------
> 6 | 5 | 4
> (1 row)
> ```
>
> After:
>
> >> For example, count(*) returns the total number of input rows; count(f1)
> returns the number of input rows in which f1 is not null, since count
> ignores null values; and count(distinct f1) returns the number of distinct
> non-null values of f1.

I see your point that this could be clearer. How is this patch?

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Do not let urgent matters crowd out time for investment in the future.

Attachment Content-Type Size
agg_null.diff text/x-diff 1.2 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2026-09-16 05:20:56 Re: 4.2.7. Aggregate Expressions
Previous Message Tom Lane 2026-09-15 14:19:30 Re: Anonymous record member access