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

What is a initialization parameter file in oracle?

0 Answers  


HI, Please let me know the syllabus for Oracle OCA and OCP Certification

0 Answers  


How to invoke the data pump import utility?

0 Answers  


How to convert the date format from dd/mm/yyyy to mm/dd/yyyy. (for eg). 22/05/2008 to 05/22/2008. when u use to_char(), it tells the month is invalid. how to resolve this problem.tel with eg.

2 Answers   AppLabs,


what is difference between cartesian join & cross join even they give same result?

4 Answers   Bank Of America,






what are the things that you consider while creating indexes on partitioning tables?

1 Answers  


What is indexing, and how does it improve performance?

1 Answers  


What is the relation of a user account and a schema?

0 Answers  


What operating systems are supported by oracle database 10g xe?

0 Answers  


What is the effect of setting the value 'FIRST_ROWS' for OPTIMIZER_GOAL parameter of the ALTER SESSION command ?

1 Answers  


What is oracle instant client?

0 Answers  


What is forall Statement ?

2 Answers   Thermotech,


Categories
  • Oracle General Interview Questions Oracle General (1808)
  • 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)