HAVING Clause Without a Group Function

select deptno, count(*)
from employees
group by deptno
having deptno <= 20;
DEPTNO COUNT(*)
-------- --------
10 3
20 5
select deptno, count(*)
from employees
where deptno <= 20
group by deptno;
DEPTNO COUNT(*)
-------- --------
10 3
20 5

你可能感兴趣的:(HAVING Clause Without a Group Function)