How do u count no of rows in a table?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to Declare Fixed Length String Value In PL SQL

663


What is a pl/sql block?

595


What is difference between table and view?

526


What does an inner join do?

561


what is the use of set statement in tsql? : Transact sql

536






Can we use commit inside a trigger?

529


What is a ddl command?

534


What is the limitation on the block size of pl/sql?

532


What are the different ddl commands in sql?

581


What do you mean by query optimization?

548


What is count * in sql?

553


What is database sql?

541


How many triggers can be applied to a table?

600


What is a trigger in sql?

638


What is the difference between a procedure and a function?

494