How do u count no of rows in a table?

Answers were Sorted based on User's Feedback



How do u count no of rows in a table?..

Answer / gunturajesh

select count(*) from table will give the number of rows in
the table including null values

Is This Answer Correct ?    32 Yes 3 No

How do u count no of rows in a table?..

Answer / bj

select count(1) from <table_name>;

By this also we can count no of rows in a table.

Is This Answer Correct ?    19 Yes 2 No

How do u count no of rows in a table?..

Answer / prakash kumar

select max(rownum)from table_name;
this will also give number of rows in your table

Is This Answer Correct ?    9 Yes 3 No

How do u count no of rows in a table?..

Answer / prabhudatta barick

Please ignore my first answer...

as By default this job runs within a maintenance windows
between 10 P.M. to 6 A.M. week nights and all day on
weekends.

to get the exact record please use this

ANALYZE TABLE <table_name> COMPUTE STATISTICS;

SELECT num_rows
FROM dba_tables
WHERE table_name = '<TABLE_NAME>';

Is This Answer Correct ?    3 Yes 1 No

How do u count no of rows in a table?..

Answer / prabhudatta barick

Automatic Optimizer Statistics Collection
By default Oracle 10g automatically gathers optimizer
statistics using a scheduled job called GATHER_STATS_JOB.

As it gathers table statistics automatically
so no need to gather table statistics before
running this query.

SELECT num_rows
FROM dba_tables
WHERE table_name = '<TABLE_NAME>';

This will give u the total no. of records in a table....

Is This Answer Correct ?    1 Yes 0 No

How do u count no of rows in a table?..

Answer / bolearner

There are 2 ways used to find the row count of any table.

SELECT COUNT(*) FROM EMP;

SELECT TABLE_NAME, NUM_ROWS FROM USER_TABLES WHERE TABLE_NAME='EMP';

Is This Answer Correct ?    0 Yes 0 No

How do u count no of rows in a table?..

Answer / siri

select count(*) from table_name

Is This Answer Correct ?    0 Yes 0 No

How do u count no of rows in a table?..

Answer / amaresh

write this quire "SQL>desc tablename;

Is This Answer Correct ?    2 Yes 14 No

Post New Answer

More SQL PLSQL Interview Questions

What are commit, rollback, and savepoint?

0 Answers  


What are different methods to trace the pl/sql code?

0 Answers  


Does db2 use sql?

0 Answers  


How do I partition in sql?

0 Answers  


What is the difference between SQL table and the PLSQL table?

3 Answers   Mastek,






What is sql comments?

0 Answers  


How do you optimize a query?

0 Answers  


what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql

0 Answers  


What is a table in a database?

0 Answers  


Write a sql query to find the names of employees that begin with ‘a’?

0 Answers  


Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /executed/work)

6 Answers  


How to execute OS(operating system) command from pl/sql?

3 Answers  


Categories