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

the 4th answer is(ignore the previous one)

db2=> with t1(a,b,c) as (select id,name,row_number()
over(order by id desc) as aa from tab1) select * from t1
where c=2

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of reorg in db2?

604


How many databases can be created inside an instance in db2 ?

599


Mention the definition of cobol in varchar field.

697


What is the physical storage length of date data type?

730


What is the reason behind not using select * in embedded sql programs?

603






What is scrollable cursor in db2?

583


What are packages in db2?

597


What is the meaning concurrency in the db2 database?

634


How can deadlocks be resolved?

542


What is the use of predicate?

586


What is the advantage in De-normalizing tables in DB2?

747


What is the difference between dbm cfg and db cfg file in db2 ?

1006


What is innodb buffer pool?

564


Which component is used to execute the sql statements?

619


How to find the number of rows in db2 tables?

617