Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.7节遗漏未译 #435

Open
yukaijian opened this issue Sep 25, 2023 · 1 comment
Open

2.7节遗漏未译 #435

yukaijian opened this issue Sep 25, 2023 · 1 comment

Comments

@yukaijian
Copy link

2.7. Aggregate Functions最后部分:
Another way to select the rows that go into an aggregate computation is to use FILTER, which is a per-aggregate option:

SELECT city, count(*) FILTER (WHERE temp_lo < 45), max(temp_lo)
FROM weather
GROUP BY city;
city | count | max
---------------+-------+-----
Hayward | 1 | 37
San Francisco | 1 | 46
(2 rows)
FILTER is much like WHERE, except that it removes rows only from the input of the particular aggregate function that it is attached to. Here, the count aggregate counts only rows with temp_lo below 45; but the max aggregate is still applied to all rows, so it still finds the reading of 46.
这部分内容从PG10.0开始就有了,一直未翻译。

TsinghuaLucky912 pushed a commit to TsinghuaLucky912/pgdoc-cn that referenced this issue Feb 21, 2024
@TsinghuaLucky912
Copy link
Contributor

request

已补充

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants