Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

can we use group by clause in cursor

$
0
0
hie, how can we use group by clause in select statement for cursor.

for example
i used

CREATE OR REPLACE PROCEDURE SHOW_ATTENDANCE_RECORD
AS
CURSOR ATT_PEOPLE IS
SELECT c.MID COUNT(c.ATT)
FROM ATTENDANCE c,
WHERE c.ATT = '&ATT'
GROUP BY c.MID
BEGIN
FOR DISPLAY IN ATT_PEOPLE LOOP
DBMS_OUTPUT.PUT_LINE('ID NO:'||display.MID, COUNT(c.ATT));
END LOOP;
END;

how can we show the count in the procedure and use the group by clause in order to do so ..

many thanks

Viewing all articles
Browse latest Browse all 13329

Trending Articles