Do we need cursor for Count(*)?

Answers were Sorted based on User's Feedback



Do we need cursor for Count(*)?..

Answer / nak

No,Count(*) will give u the number of record in a table.

Ex: select Count(*) from EMP table where EMPNAME='sunil'

Is This Answer Correct ?    13 Yes 1 No

Do we need cursor for Count(*)?..

Answer / yaswanth

we will use cursors when we have situation like the query
returning multiple rows but in this case
select Count(*) from EMP table where EMPNAME='some' will
return only one row, i.e how many rows it found with
EMPNAME='some' eg:3 or 4 or 5 ... so there is no concept of
cursor here

Is This Answer Correct ?    9 Yes 3 No

Do we need cursor for Count(*)?..

Answer / shravan kumar.p

no need..
select count(*) from the emp.
it will give the total no of rows in a table..

Is This Answer Correct ?    2 Yes 0 No

Do we need cursor for Count(*)?..

Answer / sachin borase

select 8 from table fetch first 3 rows only

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More DB2 Interview Questions

What is dbrm library?

0 Answers  


Can we update view in db2?

0 Answers  


What is a SELECT statement?

1 Answers  


Can we use group-by clause in sub-query? If 'yes' means,Will it be executed successfully or else If 'no' means why should we not using that method? Give me your suggestion please....

1 Answers  


What is referential integrity?

5 Answers  






Explain various types of locks in db2?

0 Answers  


What is db2 bind process?

0 Answers  


How Plan is created while executing the query using SPUFI?

3 Answers  


I have a subprogram B calling from mainprogram A.I have opened a cursor in A ,Can i fetch the same cursor in subprogram B , If yes , Please explain the reason?

0 Answers   HeadStrong,


What is the difference between drop table and delete table?

0 Answers  


What is rct?

0 Answers  


How can i install db2 9.x on AIX based system..? plz reply the detailed steps involved....?

0 Answers   IBM, TCS,


Categories