<s>
A	O
HAVING	O
clause	O
in	O
SQL	B-Language
specifies	O
that	O
an	O
SQL	B-Language
SELECT	I-Language
statement	O
must	O
only	O
return	O
rows	O
where	B-Language
aggregate	O
values	O
meet	O
the	O
specified	O
conditions	O
.	O
</s>
<s>
HAVING	O
and	O
WHERE	B-Language
are	O
often	O
confused	O
by	O
beginners	O
,	O
but	O
they	O
serve	O
different	O
purposes	O
.	O
</s>
<s>
WHERE	B-Language
is	O
taken	O
into	O
account	O
at	O
an	O
earlier	O
stage	O
of	O
a	O
query	O
execution	O
,	O
filtering	O
the	O
rows	O
read	O
from	O
the	O
tables	O
.	O
</s>
<s>
Therefore	O
,	O
WHERE	B-Language
applies	O
to	O
data	O
read	O
from	O
tables	O
,	O
and	O
HAVING	O
should	O
only	O
apply	O
to	O
aggregated	O
data	O
,	O
which	O
is	O
n't	O
known	O
in	O
the	O
initial	O
stage	O
of	O
a	O
query	O
.	O
</s>
<s>
To	O
view	O
the	O
present	O
condition	B-Language
formed	O
by	O
the	O
GROUP	O
BY	O
clause	O
,	O
the	O
HAVING	O
clause	O
is	O
used	O
.	O
</s>
