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
Explain in brief how does db2 determine what lock-size to use?
what are bind concepts in db2 cobol?
Mention the definition of cobol in varchar field.
What does db2 blu stand for?
What is commit in db2?
What is a storage group (stogroup)?
How do we specify index to include or not during bind process.
How can you classify the locks in db2?
What is db2 optimizer?
Can you tell me how can you find out the # of rows updated after an update statement?
What is db2 purescale?
What is buffer pool in the db2 database?
How many databases are there?
What is a db2 table?
How to access db2 tables in mainframe?