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

Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

0 Answers  


write a query to find out the no. of employees whose age is less than 25 and max of salary for the employees belonging to a particular department is less than 20000

6 Answers  


What is rownum in sql?

0 Answers  


Create table emp (id number(9), name varchar2(20),salary number(9,2)); The table has 100 records after table created.Now i nee to change id's Datatype is to be Varchar2(15). now Alter table emp modify(id varchar2(15),name varchar2(20), salary number(9,2)); Whether it will work or returns error? post answer with explanation.

13 Answers   Oracle, TCS,


table having two columns - entity,zone enity zone pen east pen west pen north pen south pen east pencil east pencil east pencil west I want the output as : entity east west north south pen 2 1 1 1 pencil 2 1 0 0

2 Answers  


What is java sql driver?

0 Answers  


What is nvarchar in sql?

0 Answers  


What operating systems are supported by oracle sql developer?

0 Answers  


how to install mysql? : Sql dba

0 Answers  


What is ttitle and btitle?

0 Answers  


What are the different ddl commands in sql?

0 Answers  


What are sql objects?

0 Answers  


Categories