title: What is the difference between HAVING and WHERE in SQL?
body: <p>What is the difference between <code>HAVING</code> and <code>WHERE</code> in an <code>SQL SELECT</code> statement?</p>
  <p>EDIT: I have marked Steven's answer as the correct one as it contained the key bit of information on the link:</p>
  <blockquote>
  <p>When <code>GROUP BY</code> is not used, <code>HAVING</code> behaves like a <code>WHERE</code> clause</p>
  </blockquote>
  <p>The situation I had seen the <code>WHERE</code> in did not have <code>GROUP BY</code> and is where my confusion started. Of course, until you know this you can't specify it in the question.</p>