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

Can I use LOCK TABLE on a view?

1 Answers  


What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the queries be used in EXPLAIN command to check the performance.

3 Answers   IBM,


what is a plan and how do you refer the plan in the program?

2 Answers   Xansa,


can we update the table by using cursors can anyone post the query?

5 Answers   DELL, HCL,


My sql statement select avg(salary) from emp yields inaccurate results. Why?

0 Answers  






Comment whether the cursor is closed during commit or not.

0 Answers  


How do I optimize a query in db2?

0 Answers  


can we view the access paths created by dbrm ? how ? thx

2 Answers   IBM,


How to resolve deadlock issue

5 Answers   IBM,


What language is db2 written in?

0 Answers  


What does db2 blu stand for?

0 Answers  


What is a page in db2?

0 Answers  


Categories