title: Oracle sql, ora is thrown: group function is not allowed here
body: <p>I want to execute following SQL script</p>
  
  <pre><code>SELECT 
      t1.Technology, 
      count(t1.trax_id) as "Current number of items",  
      TO_CHAR(MAX(TO_DATE('20000101','yyyymmdd') +
         (SYSDATE - t1.time_event)),'hh24:mi:ss') as "max_ages"
  FROM 
      dm_procmon t1
  GROUP BY
      t1.Technology, count(t1.trax_id), 
      TO_CHAR(MAX(TO_DATE('20000101','yyyymmdd') +
         (SYSDATE - t1.time_event)), 'hh24:mi:ss')
  HAVING 
      COUNT(t1.trax_id) = 1;
  </code></pre>
  
  <p>When I execute it following exception is thrown</p>
  
  <blockquote>
    <p>Error at Command Line : 3 Column : 7<br>
    Error report - SQL Error:<br>
    ORA-00934: Groepsfunctie is hier niet toegestaan.<br>
    00934. 00000 -  "group function is not allowed here"</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>