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 pl/sql source code can be protected?
what is 'mysqladmin' in mysql? : Sql dba
how to start mysql server? : Sql dba
What is ON DELETE CASCADE?
How do I partition a table in sql?
What is sql*loader and what is it used for?
i have a table like this. i want to output like this c1 c2 c1 c2 1 10 1 10 2 20 2 30 3 30 3 60 4 40 4 100 5 5 5 105 c1 and c2 are columns in a table .i want output like this c2 values are 10,10+20,10+20+30,10+20+30+40.10+20+30+40+5. write a sql query.pls help this i want urgent.
2 Answers IBM, Loginworks, OFSS,
What is substitution variable in pl sql?
What is the difference between RDBMS and DBMS?
20 Answers Practical Viva Questions, Sapient, Stag Computers,
How to find the count of letter "L" in HELLO
Explain what is an index?
Can I call a procedure inside a function?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)