title: sql having clause with aggregate functions
body: <pre><code>select regno
  from examinee
  where score&gt;(select avg(score) from examinee)
  </code></pre>
  
  <p>How can I write the above query using 'HAVING' clause?</p>
  
  <p>I've tried writing the below version but it doesn't work(shows empty set)</p>
  
  <pre><code>select regno
  from examinee
  group by score
  having score&gt;avg(score);
  </code></pre>
  
  <p>Where am I going wrong?</p>