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 / sudipta
u may try this
assuming table 'tab1' has 2 fields id & name
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)
u try these & if any problem u may write
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Mention the location where the output received from explain statement is stored.
What does a deadlock mean in DB2?
How can you count the number of rows from a table tab?
What is the use of dclgen in db2?
What is isolation level in db2?
Before you give the explain statement, what are the prerogatives?
Why select is not preferred in embedded sql programs?
How can deadlocks be resolved?
What is the role of the data page in the db2 database?
What is db2 purescale?
How many databases are there?
What is data manager?
Who uses db2?
What is db2 look?
What do you mean by commit and rollback?