4.2.7. Aggregate Expressions

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: y(dot)saburov(at)gmail(dot)com
Subject: 4.2.7. Aggregate Expressions
Date: 2026-08-27 14:26:46
Message-ID: 178784080621.1060526.4544192651418189612@wrigleys.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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.

We haven’t seen the term “f1” before—and the paragraph doesn’t specify that
this is a field.

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2026-08-27 14:47:51 Re: 4.1.2.3. String Constants with Unicode Escapes
Previous Message PG Doc comments form 2026-08-27 08:44:29 4.1.4. Special Characters