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 I introduce multiple conditions in like operator?

0 Answers  


Explain the difference between sql and oracle?

0 Answers  


I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?

5 Answers   Zensar,


What are the types of trigger in oracle?

0 Answers  


How do you bind variables in oracle?

0 Answers  






7. Repeat query (7) but also display all clients who have never ordered anything.

1 Answers   Wipro,


if you ctreate table identity

0 Answers  


How do we switch from init.ora file to asp file?

2 Answers  


write sql query following source are EmpID, Salary 101 1000 102 2000 103 3000 I want the output format like following empid,sal,composite_sal 101 1000 1000 102 2000 3000 103 3000 6000

4 Answers   TCS,


One Table having two rows with one colomn having values Like"Male" and "Female". how to upadte these values Like "Female" and "Male" in single update statement.

6 Answers   Polaris,


How to change user password in oracle?

0 Answers  


How to delete a user account in oracle?

0 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)