i thought santosh wanted records based on value that is 1st 10 minimal values and last 10 max values...well if this is not the case than the solution that i had send using rownum is obsolete and hence ignore it....
 
rgds,
Ams.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Alexandre Gorbatchev
Sent: Wednesday, August 14, 2002 3:08 PM
To: Multiple recipients of list ORACLE-L
Subject: 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
----- Original Message -----
Sent: Wednesday, August 14, 2002 11:48 AM
Subject: Finding out last 10 records

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

 

Reply via email to