without using count(*) and rownum how can we count total
record in a table

Answers were Sorted based on User's Feedback



without using count(*) and rownum how can we count total record in a table..

Answer / ganesh prasad sial

select sum(1) from emp;

Is This Answer Correct ?    38 Yes 2 No

without using count(*) and rownum how can we count total record in a table..

Answer / sudipta santra

select count(rowid) from emp;

Is This Answer Correct ?    23 Yes 4 No

without using count(*) and rownum how can we count total record in a table..

Answer / vignesh lakshmirajan

simple..!!! Findout the primary key of the table..

then..

select count(primary_key_column) from table;

thats all; becos count vil work with non-null values.

primary key cant b null..
so.. v can use count on primary key...

Is This Answer Correct ?    13 Yes 1 No

without using count(*) and rownum how can we count total record in a table..

Answer / sanrai

Select max(rownum) From dual

Is This Answer Correct ?    7 Yes 4 No

without using count(*) and rownum how can we count total record in a table..

Answer / rajesh

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

TABLE_NAME NUM_ROWS
------------------------------ ----------
EMP 14

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Oracle General Interview Questions

How can we Update a table with out using UPDATE command?

1 Answers  


In Oracle 10g, "g" Stands for what?

5 Answers   Mphasis,


if i am using dml statement in function. then i am writing select statement what was the output

2 Answers   MasterCard,


Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.

0 Answers   Wipro,


What is an oracle database table?

0 Answers  






how many outer joins are used in a single sql query? is there any limitations for using of outer joins?

2 Answers   BOB Technologies, Cap Gemini, IBM,


What is an Integrity Constrains ?

3 Answers  


what is index?

4 Answers  


Explain the family trees and connection by clause

0 Answers  


How to run queries on external tables?

0 Answers  


How many types of cluster table in Oracle?

0 Answers   MCN Solutions,


How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)