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
Can you inner join the same table?
What is pl sql quora?
How many types of indexes are there in sql?
Is clustered index a primary key?
Can a procedure in a package be overloaded?
How do you declare a variable in pl sql?
How to get unique records from a table?
Define union, minus, union all, intersect ?
What is the difference between stored procedure and view?
Can a key be both primary and foreign?
What is the difference between subquery and correlated query?
How do you write a subquery?
What does 0 mean in sql?
What is primary key and foreign key with example?
Is a foreign key always unique?