I must be googling in the wrong way or I'm having a stupid moment in time.
What's the difference between HAVING
and WHERE
in an SQL SELECT
statement?
EDIT: I've marked Steven's answer as the correct one as it contained the key bit of information on the link:
When
GROUP BY
is not used,HAVING
behaves like aWHERE
clause
The situation I had seen the WHERE
in did not have GROUP BY
and is where my confusion started. Of course, until you know this you can't specify it in the question.
Many thanks for all the answers which were very enlightening.