Write a procedure to return the month and the number of
developers joined in each month (cursor )
Answer Posted / rajesh venati
CREATE OR REPLACE PROCEDURE PRO
IS
CURSOR ECUR IS SELECT TO_CHAR(HIREDATE,'MON')
V_MONTH,COUNT(*) V_NO FROM EMP GROUP BY TO_CHAR(HIREDATE,'MON');
BEGIN
FOR V_ECUR IN ECUR LOOP
DBMS_OUTPUT.PUT_LINE(V_ECUR.V_MONTH||' '||V_ECUR.V_NO);
END LOOP;
END;
SQL> EXEC PRO;
DEC 3
APR 2
NOV 1
SEP 2
FEB 2
JUN 1
MAY 2
JAN 1
Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
How do you pronounce sql?
what are the drivers in mysql? : Sql dba
What is sql catalog?
How do I start sql profiler?
what are the different tables present in mysql? : Sql dba
how can we find the number of rows in a table using mysql? : Sql dba
What is plpgsql language?
how to include comments in sql statements? : Sql dba
how to enter characters as hex numbers? : Sql dba
What found sql?
What is the mutating table and constraining table?
What is an index? What are the types of indexes? How many clustered indexes can be created on a table?
What is left inner join in sql?
Can variables be used in sql statements?
How is sql used in oracle?