How will fetch last 5 rows from table in db2

Answer Posted / mayur bhayani

SELECT * FROM (SELECT * FROM T ORDER BY pk DESC FETCH FIRST 5 ROWS) AS X
ORDER BY PK;

Is This Answer Correct ?    3 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the contents of a dclmgen?

628


Can you use max on a char column?

638


How can the duplicate values be eliminated from db2 select?

623


What is blu acceleration in db2?

603


Explain in brief how does db2 determine what lock-size to use?

591






Define declaration generator (dclgen).

665


Explain about cursor stability?

621


What is a bind card?

679


Which is faster delete or truncate?

675


How do I copy a table in db2?

573


What is ibm db2 connect?

570


Why cursor is used in db2?

572


How do I change the column size in db2?

589


How do I delete a table in database?

595


What is the use of db2 optimizer?

608