title: ERROR 1111 (HY000): Invalid use of group function
body: <p>Given a staff table with the following attributes:</p>
  <blockquote>
  <p>ec,name,code,dob,salary</p>
  </blockquote>
  <p>List the staff members earning more than the average salary.</p>
  <p>My solution:</p>
  <pre><code>select* from staff where salary &gt; avg(salary);
  </code></pre>
  <p>What is wrong with it?</p>