Having
clause is a clause of select statement responsible to restart a group depending
on a condition. The basic diff between and having clause is where is meant for
row restriction and having is meant for group restriction.
Syntax
of select using having
Select <exp>
From <t_name>
[where <cond>]
[group by<col_name>]
[having<group _ cond>]
Exm
:-
Select
deptno, job, max(sal), min(sal), sum(sal),count(*) from emp
Where
deptno!=30
Group
by deptno,job
Having
max(sal)>2000;
(OPTIMISEDQUERY)