How do u count no of rows in a table?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 can you get sql*loader to commit only at the end of the load file? : aql loader
What is null in pl/sql?
what is the difference between char_length and length? : Sql dba
In what condition is it good to disable a trigger?
Why do we use procedures?
how to write utl file pkg in SQL
What are the two different parts of the pl/sql packages?
explain mysql aggregate functions. : Sql dba
Is nosql faster than sql?
What is normalization in a database?
How subquery works in sql?
what is the difference between ereg_replace() and eregi_replace()? : Sql dba