Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to count the no of records of a table without using
COUNT function?

Answers were Sorted based on User's Feedback



How to count the no of records of a table without using COUNT function?..

Answer / kart

select max(rownum) from table

Is This Answer Correct ?    65 Yes 5 No

How to count the no of records of a table without using COUNT function?..

Answer / l meher

select max(rownum) from table_name;

Is This Answer Correct ?    24 Yes 0 No

How to count the no of records of a table without using COUNT function?..

Answer / sandeep

select max(rownum) from table_name;

Is This Answer Correct ?    4 Yes 2 No

How to count the no of records of a table without using COUNT function?..

Answer / ajit

declare
cursor c1
is
select * from emp;
i c1%rowtype;
begin
open c1;
loop
fetch c1 into i ;
exit when c1%notfound;
end loop;
dbms_output.put_line(c1%rowcount);
close c1;
end;

Is This Answer Correct ?    2 Yes 0 No

How to count the no of records of a table without using COUNT function?..

Answer / satya

select sum(1) from table_name;

Is This Answer Correct ?    4 Yes 3 No

How to count the no of records of a table without using COUNT function?..

Answer / senthil kumar

Hi Ramaprasad 'select max(rownum) from emp; ' this is passible
but

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;

this is NOT Passible , because this one just show all records Not count it.......

Is This Answer Correct ?    0 Yes 1 No

How to count the no of records of a table without using COUNT function?..

Answer / vikram

select col1,col2,1 as SNO,sum(sno) from emp
group by 1,2,3

Is This Answer Correct ?    0 Yes 1 No

How to count the no of records of a table without using COUNT function?..

Answer / suneelkumar

Hi guys..

rownum is virtual column we con't use max(rownum) i t will
give the error unknown colum...

so by using cursor we can count

Is This Answer Correct ?    0 Yes 2 No

How to count the no of records of a table without using COUNT function?..

Answer / 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

How to count the no of records of a table without using COUNT function?..

Answer / kart

using select command
select * from xxx; we will get the no of rows at bottom
if the feedback is unset

then use the plsql with cursor;

select rownum from table; the last value
is the number of records

Is This Answer Correct ?    4 Yes 9 No

Post New Answer

More SQL PLSQL Interview Questions

What is difference between hql and sql?

0 Answers  


hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews

0 Answers  


What are the types of sql commands?

0 Answers  


What is a constraint? Tell me about its various levels.

0 Answers  


Explain uses of cursor.

1 Answers  


how can we write a column values horizontal by using sql stmt; ex: select name from table_name;(actual output) a b c d require output is a b c d

5 Answers   Honeywell, Interact,


What is the use of time stamp in select statement?

1 Answers   TCS,


What are the blocks in stored procedure?

6 Answers   Microsoft,


what are date and time data types in mysql? : Sql dba

0 Answers  


What is a 'instead of trigger'?

3 Answers   Eenadu, TCS,


Is pl sql better than sql?

0 Answers  


Which is better varchar or nvarchar?

0 Answers  


Categories