- 类别:
HAVING¶
筛选由 GROUP BY 生成的不满足谓词的行。
语法¶
SELECT ...
FROM ...
GROUP BY ...
HAVING <predicate>
[ ... ]
Parameters¶
predicate
布尔表达式。
使用说明¶
示例¶
查找雇员人数少于 10 人的部门:
SELECT department_id FROM employees GROUP BY department_id HAVING count(*) < 10;