title: error in oracle pl/sql: group function is not allowed here
body: <p>--table st (sid int, sname varchar2(10), total int, grade varchar(2))</p>
  
  <p>My piece of code is the following.</p>
  
  <pre><code>declare
  totsum number;
  average number;
  procedure sumavg(x out number, y out number) is
  begin
  select sum(total) into x, avg(total) into y from st;
  end;
  
  begin
  sumavg(totsum,average);
  dbms_output.put_line('Sum: '||totsum||' Average: '||average);
  end;
  /
  </code></pre>
  
  <p>This give the error:</p>
  
  <pre><code>ORA-06550: line 6, column 31:
  PL/SQL: ORA-00934: group function is not allowed here
  ORA-06550: line 6, column 5:
  PL/SQL: SQL Statement ignored
  4.     procedure sumavg(x out number, y out number) is
  5.     begin
  6.     select sum(total) into x, avg(total) into y from st;
  7.     end;
  8.   
  </code></pre>
  
  <p>I need to display values totsum and average. Please help with a corrected code. Thank you.</p>