hie, how can we use group by clause in select statement for cursor.
CREATE OR REPLACE PROCEDURE SHOW_ATTENDANCE_RECORD
CURSOR ATT_PEOPLE IS
SELECT c.MID COUNT(c.ATT)
FROM ATTENDANCE c,
WHERE c.ATT = '&ATT'
GROUP BY c.MID
FOR DISPLAY IN ATT_PEOPLE LOOP
DBMS_OUTPUT.PUT_LINE('ID NO:'||display.MID, COUNT(c.ATT));
how can we show the count in the procedure and use the group by clause in order to do so ..
No problem in using GROUP BY in cursor (your code is invalid; misses comma between MID and COUNT; has comma in the FROM clause; misses a terminating semi-colon after the GROUP BY clause and maybe something else which I didn't bother to find. Please, don't post rubbish code - check it first!).
DBMS_OUTPUT.PUT_LINE accepts one parameter so you'll have to concatenate all you want to display.