PostgreSQL GROUP BY

GROUP BY 分组聚合:SELECT 中出现的非聚合列必须都在 GROUP BY 里(PostgreSQL 强制检查)。

Beginner
Key PointsPostgreSQL,GROUP BY,分组,聚合

讲解

GROUP BY 分组聚合:SELECT 中出现的非聚合列必须都在 GROUP BY 里(PostgreSQL 强制检查)。

示例

SQL
SELECT age, count(*) AS cnt FROM company GROUP BY age;

Friends & Partners