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 the function of data manager.
What is node in db2?
What is a storage group (stogroup)?
How is the value function used?
What is a bind card?
On which levels locks can be applied?
When do you specify the isolation level?
Why do chiropractors use drop table?
What is a trigger in the db2 database?
What is universal database?
What type of database is db2?
Which are the db2 tools to protect integrity of the database?
What are packages in db2?
How can the duplicate values be eliminated from db2 select?
run jcl for cobol+db2 pgm?.. //jobcard //step001 exec pgm=ikjeft01 //systin dd * DSNSYSTEM(--------) RUN PROGRAM(MYPGMNAME) PLAN(-----), LIB(-------), PARMS(------) /* WHAT WILL U GIVE INSIDE THE BRACKETS... WHAT IS PLAN,PACKAGE,BIND?..PLAN N PACAKGES ARE GENERATED BY ?...