Re: selecting last n records from the table
From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Thu, 06 Jun 2002 14:09:28 GMT
Message-ID: <s2KL8.181783$L76.263373_at_rwcrnsc53>
Date: Thu, 06 Jun 2002 14:09:28 GMT
Message-ID: <s2KL8.181783$L76.263373_at_rwcrnsc53>
select * from (select rownum r, * from mytable) where field1<100 and r<10;
Although what the last 10 records mean in a heap is meaningless. That is if
you don't specify an order then you should not rely on one.
Jim
"marsaroid" <marsaroid_at_yahoo.co.uk> wrote in message
news:34343c2e.0206060532.5aa8c704_at_posting.google.com...
> Is there a way to select the last n records from a table in oracle
> based on a criteria. For ex. select * from table where field1 < 100
> and rownum < 10. So out of the returned set of the query i just need
> the last 10 rows of the returned result instead of all.
Received on Thu Jun 06 2002 - 16:09:28 CEST