How will fetch last 5 rows from table in db2

Answer Posted / mahyn

select * from tablename
order by primary_key desc
fetch first 5 rows only
with ur;

can be one way...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention some fields that are a part of sqlca.

782


What os does db2 run on?

750


Following a db2 update statement, what is the quickest way to compute the total number of updated rows?

826


Which isolation level provides maximum concurrency?

896


Differentiate between cs and rr isolation levels? Where do you specify them?

828


How can you do the explain of a dynamic sql statement?

824


Name the lockable units in DB2?

895


What parameters are used to control the free space in DB2?

840


Explain the contents that are a part of dclgen.

869


How is the value function used?

835


What is a plan and package in db2?

841


What is cascading rollback?

856


How do you stop a db2 database in linux?

747


What is db2 and what is the use of db2 optimizer?

832


What is schema in db2?

777