https://www.postgresql.org/docs/15/tutorial-agg.html - Mailing list pgsql-docs

From PG Doc comments form
Subject https://www.postgresql.org/docs/15/tutorial-agg.html
Date
Msg-id 166880679445.636.13036369289525357491@wrigleys.postgresql.org
Whole thread Raw
Responses Re: https://www.postgresql.org/docs/15/tutorial-agg.html  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/tutorial-agg.html
Description:

city   | max | count
---------+-----+-------
 Hayward |  37 |     5
(1 row)
it's not right

SELECT city, max(temp_lo), count(*) FILTER (WHERE temp_lo < 30)
    FROM weather
    GROUP BY city
    HAVING max(temp_lo) < 40;

  city   | max | count
---------+-----+-------
 Hayward |  35 |     0

because
SELECT city, max(temp_lo), count(*) FILTER (WHERE temp_lo < 30)
    FROM weather
    WHERE city LIKE 'S%'            -- (1)
    GROUP BY city
    HAVING max(temp_lo) < 40;
 city | max | count
------+-----+-------
(0 rows)

pgsql-docs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Merge statement
Next
From: Tom Lane
Date:
Subject: Re: https://www.postgresql.org/docs/15/tutorial-agg.html