How to count the no of records of a table without using
COUNT function?
Answer Posted / ramaprasad
select rownum from emp;
select max(rownum) from emp;
declare
cursor c1(dpno emp.deptno%type)is select * from emp where
deptno=dpno;
i c1%rowtype;
begin
open c1(dpno);
loop
fetch c1 into i ;
exit when c1%notfound;
dbms_output.put_line(c1%rowcount);
end loop;
close c1;
end;
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What are different types of sql?
What do you think about pl/sql?
what are the differences among rownum, rank and dense_rank? : Sql dba
What are the different types of database management systems?
Explain how exception handling is done in advance pl/sql?
what are the 'mysql' command line options? : Sql dba
If a cursor is open, how can we find in a pl/sql block?
How do I send sql query results to excel?
Which are the different types of indexes in sql?
What is a heap in sql?
What are different joins used in sql?
how can we destroy the cookie? : Sql dba
what are the disadvantages of mysql? : Sql dba
Is the primary key an index?
What is group function in sql?