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 / sarath
1) select id,name from tab1 order by id desc fetch first
row only
2) select id,name from tab1 order by id desc
3) select id,name from tab1 order by id desc fetch first 5
rows only
4) select id,count(*),name from tab1 order by id where count
(*) = (select count(*) from tab1)-1
Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What are the full forms of spufi and dclgen and why are they used?
What are the two types of logging in the db2 database? Explain them.
What is the difference between using bind () and rebind () methods of naming class?
If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2
What is buffer pool in the db2 database?
List down the types of triggers in the db2 database?
What is multi row fetch in db2?
What is access path in db2?
What is buffer pool and list some of them?
How do you simulate the explain of an embedded sql statement in spufi/qmf?
What are the various isolation levels possible?
What is the use of dclgen in db2?
How can we retrieve the total number of records in RPG & CLLE?
What are iseries servers?
What types of tables are there in the db2 database?