Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Finding out last 10 records
Santosh,
There is no "last" and "first" records in relational databases in terms of location. All records are equal and may be stored physically anywhere. I guess that may be possible (parsing ROWID and using information about extent location) to sort records by extent, block and number of record inside block, but that's not a trivial task. If you need to select last 10 inserted records, make a trigger with filling a timestamp into a column and select with sort by this column using rownum in where condition.
Alexandre
Hello all
Could any one of you guide me on how to select last 10 records from a table. and also finding out first 10 records..
Thanks and regards,
Santosh
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Alexandre Gorbatchev
INET: alexandre.gorbatchev_at_avermann.de
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Aug 14 2002 - 06:08:23 CDT