The problem lies in what to do with the multiple results implied by this question. If you want to use a cursor and group, then fetch, no problem. If you merely want to group and select into, then what happens when you return multiple results? You can execute that select, but it could very well generate errors often.
an example where u can use a group by clause in a pl/sql block
declare
cursor c1 is
select sum(sal) sal,deptno from emp
group by deptno;
a c1%rowtype;
begin
for i in c1 loop
dbms_output.put_line(i.sal||' '||i.deptno);
end loop;
end;
Bookmarks