聚合函数的 FILTER 子句
已记录的来源状态与原始语言说明;缺少版本证据时明确标为未知。
来源快照记录 PostgreSQL 8.1–18 的变化节点;历史矩阵独立记录 7.4–18 的状态。两者均未记录 PostgreSQL 19 或 20 的支持状态,较新版本明确保留为未知。这些来源声明与运行测量相互独立。
自定义函数、存储过程和触发器
说明
聚合函数现在可以使用 FILTER 子句进行过滤。例如:count(col_a) FILTER (WHERE col_b > 5)
所选版本: PostgreSQL 18
支持
比较版本
原始文档链接
已记录旧标识: 263
完整来源事实与出处
yaml · center · 1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd
{
"Key": "filter-clause-for-aggregate-functions",
"SourceKind": "yaml",
"SourceDatabase": "center",
"SourceTable": "featurematrix.yaml",
"SourceKey": "FILTER clause for aggregate functions",
"SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
"Name": "FILTER clause for aggregate functions",
"NameLocale": "en",
"GroupKey": "custom-functions-stored-procedures-triggers",
"GroupName": "Custom Functions, Stored Procedures, \u0026 Triggers",
"GroupLocale": "en",
"Ordinal": 7,
"GroupOrder": 18,
"Facts": {
"feature": {
"description": "Aggregate functions can now be filtered with the FILTER clause. For example: count(col_a) FILTER (WHERE col_b \u003e 5)",
"name": "FILTER clause for aggregate functions",
"versions": {
"9.4": "Yes"
}
},
"group": "Custom Functions, Stored Procedures, \u0026 Triggers",
"versions": {
"max": 18,
"min": 8.1
}
},
"Cells": [
{
"Version": "10",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "11",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "12",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "13",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "14",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "15",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "16",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "17",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "18",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "8.1",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "8.2",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "8.3",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "8.4",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "9.0",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "9.1",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "9.2",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "9.3",
"State": "no",
"EvidenceKind": "yaml-default-no",
"TransitionVersion": "",
"Supported": false,
"Original": "No"
},
{
"Version": "9.4",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "9.5",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
},
{
"Version": "9.6",
"State": "yes",
"EvidenceKind": "yaml-transition",
"TransitionVersion": "9.4",
"Supported": true,
"Original": "Yes"
}
],
"Texts": [
{
"Locale": "en",
"Title": "FILTER clause for aggregate functions",
"BodyHTML": "\u003cp\u003eAggregate functions can now be filtered with the FILTER clause. For example: count(col_a) FILTER (WHERE col_b \u0026gt; 5)\u003c/p\u003e\n",
"SourceHash": "1dd22bf9a7f3ec325b894e2836fda535a25529f246a94dd41d6abbfe9997f7fd",
"ContentHash": "6bdcd16777b366385779b243556819442ee830005886abc672381adca2b7cc29",
"Payload": {
"description": "Aggregate functions can now be filtered with the FILTER clause. For example: count(col_a) FILTER (WHERE col_b \u003e 5)",
"name": "FILTER clause for aggregate functions",
"versions": {
"9.4": "Yes"
}
}
},
{
"Locale": "zh-Hans",
"Title": "聚合函数的 FILTER 子句",
"BodyHTML": "\u003cp\u003e聚合函数现在可以使用 FILTER 子句进行过滤。例如:count(col_a) FILTER (WHERE col_b \u0026gt; 5)\u003c/p\u003e\n",
"SourceHash": "071091951021357a5f492adb04caed6febf4d315ac2626ca027a48dd8ec01d50",
"ContentHash": "eff47137968b2ad23c5f744c1cd5520bc7f7b4918ef931119f256a3bfafeb067",
"Payload": {
"description": "聚合函数现在可以使用 FILTER 子句进行过滤。例如:count(col_a) FILTER (WHERE col_b \u003e 5)",
"name": "聚合函数的 FILTER 子句"
}
}
],
"GroupTitles": {
"en": "Custom Functions, Stored Procedures, \u0026 Triggers",
"zh-Hans": "自定义函数、存储过程和触发器"
},
"LegacyIDs": [
"263"
]
}