ORA-00934: group function is not allowed here 00934. 00000 - "group function is not allowed here"
<p>The question is:
give per office(kantoor) which have the total salary greater that 15000, give the average salary and the office name. use the inner join with using clausule</p>

<p>This is my current query:</p>

<pre><code>SELECT      OFF.OFFICENR,
            OFF.NAME AS OFFICE,
            AVG(SAL)
FROM        OFFICE OFF INNER JOIN EMPLOYEE EMP USING (OFFICENR)
WHERE       SUM((SAL) &gt;= 15000)                 **&lt;---line 29**
GROUP BY    OFF.OFFICENR, OFF.NAME;      
</code></pre>

<p>the query output is:</p>

<blockquote>
  <p>ORA-00934: group function is not allowed here
  00934. 00000 -  "group function is not allowed here"
  *Cause:<br>
  *Action:
  Error at Line: 29 Column: 13</p>
</blockquote>