Group By In PL?SQL Procedure
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Group By In PL?SQL Procedure

  1. #1
    Join Date
    Nov 2000
    Posts
    34

    Arrow

    Hi Friends ,

    Can We use group by caluse in select query
    in PL/SQL Procedure ? Any example will be appreciated .

    Thanks

    Jayesh

  2. #2
    Join Date
    Aug 2000
    Posts
    462
    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.

    What do you want to do?
    Oracle DBA and Developer

  3. #3
    Join Date
    Apr 2001
    Posts
    51

    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;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width