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

What do you mean by cursor?

596


What happens in bind step in a db2 program?

578


Explain db2.

630


What is rct?

761


What is the difference between nvl and coalesce?

610






What is dbrm library?

587


What is the difference between bind and rebind in db2?

868


is it compulsory commitment control in journal?

2018


What is catalog database in db2?

657


How do we specify index to include or not during bind process.

1685


What is the max length of sqlca?

778


How to fetch the last row from the table in SQL (db2)?

1046


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

611


What is a db2 collection?

613


before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?

1722