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
Can you tell me how can you find out the # of rows updated after an update statement?
How to take backup of table in db2?
DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?
How to fetch the last row from the table in SQL (db2)?
How to find primary key of a table in db2?
What is reorg and runstats in db2?
Define data page.
What is the default page size of buffer pools?
How do I add a column to an existing table in db2?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
Mention the various locks that are available in db2.
What is a db2 schema?
List out the buffer pools in db2
What are the full forms of spufi and dclgen and why are they used?
Explain what are the various isolation levels possible?