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

In cursor program-1 can we create another cursor program-2 inside the cursor program-1.If yes how/no why ?

2 Answers   Wipro,


can any one expalin check point with an example?

1 Answers  


database DSNDB01 means a.db2 catalog b.db2 directory c.BSDS d.active logs answer with reason please

1 Answers  


What is the maximum length of sqlca?

0 Answers  


why db2 is called as universal database?what is the storage capacity of db2v9 n what are the advantages of db2

3 Answers  






What is a plan and package in db2?

0 Answers  


What is the cascade rule and how does it relate to deletions made with a subselect?

1 Answers  


How to resolve -504 sql code in DB2?

2 Answers   Cap Gemini,


Explain how can you do the explain of a dynamic sql statement?

0 Answers  


What value the host varible will contain , if null indicator value is -2 ? Will it contain the truncated value or nothing will move ?

3 Answers   Cap Gemini,


Explain various types of locks in db2?

0 Answers  


what is dynamic cursor?gives syntax for this?

1 Answers   TCS,


Categories