Do we need cursor for Count(*)?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / sachin borase
select 8 from table fetch first 3 rows only
| Is This Answer Correct ? | 0 Yes | 5 No |
Which transaction use a command thread ?
How do I handle -911 (deadlock) error in a db2 program so that the program will never abend?
Do we need cursor for Count(*)?
how can we retrieve the 100 records of the file ?
what is the steps followed in EXPLAIN Process or EXPLAIN command. (Explain is for identifying the optimized access path but how or what is the steps for doing the EXPLAIN)
Why do we need reorg in db2?
What happens to a tablespace when its recovery infromation has been removed and a full recovery is no longer possible?
db2 query I have one table with the following details. SNO SNAME DOJ ------ -------------------- ---------- 10 KRISH 2007-03-19 20 REDDY 2007-05-19 30 RRRRR 2007-05-19 40 BBBBB 2008-05-19 50 CCCCC 2009-05-19 60 JJJJJ 2009-05-19 70 JJJJJ 2004-05-19 i want the output in the following format:( no of students joined in each year(no nedd to consider about month and date) year count --------- ---------- 2004 1 2007 3 2008 1 2009 2
My cobol program(not having any sql statements) is calling another cobol program ( having sql statements), what is needed for compilation and run in jcls .
What is difference between isnull and coalesce?
Give the COBOL definition of a VARCHAR field.
What statistic will tell the DBA how must space can be reclaimed from dropped table spaces on the next reorg run?