You can do like this:
select * from <table_name> where rownum <11;
This will give only the first 10 rows from the table.
If you want to get last 10 rows, you can try this:
select * from <table_name> where rownum <11 order by <key field> desc;
This will give the 10 rows from the table in the descending order of the primary key field (or any other field).
But remember one thing that : in oracle records are not placed in the tables in a physical manner, they are placed logically, so that if you want the last 10 records, you can not get them. You can get the last 10 records from the table only based on some criteria (like the order by clause).
Cheers..
Jagannadh
Main Topics
Browse All Topics





by: TWOTWOPosted on 2000-09-05 at 16:15:43ID: 4201462
You can try doing this:
rownum < 10