quary for
1> fetch last record
2> fetch in reverse order
3> fetch last 5 row
4> fetch second last record (their is no primary key)
i think concept of count can be use for this in 4th
Answer Posted / pavan
please try this one and let me know....
select * from emp where :ws-rec-cnt = (select Count(*)
into :ws-rec-cnt from emp);
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is bind plan?
What are bind parameters in db2?
What is ibm db2 used for?
Outputs of explain are with matchcols = 0. What does this signify?
How do you simulate the explain of an embedded sql statement in spufi/qmf?
What is the use of dclgen in db2?
Before you give the explain statement, what are the prerogatives?
What is difference between rollback and commit?
What is the use of value function?
How can you do the explain of a dynamic sql statement?
How will you return the number of records in table?
Mention the definition of cobol in varchar field.
Mention the different locking levels that are available in db2.
What are the 2 sqlcodes that are returned?
How does coalesce work?