Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: NEWBIE: Limit Rows Returned by Select ?

Re: NEWBIE: Limit Rows Returned by Select ?

From: Steve Cholerton <stevechol_at_freeuk.com>
Date: Mon, 09 Oct 2000 13:52:07 +0100
Message-ID: <8of3us8n63l4l4cikh8ftnevrv5d9si3bf@4ax.com>

Thanks for the response, but I am looking for the LAST 2000 records in the order of the primary key descending, in this case I do not know the rownum (how can I find the last rownum?)

-Steve

On Fri, 6 Oct 2000 10:01:23 +0200, "Arie Mars" <arie_at_pca-online.nl> wrote:

>select * from system_history
>WHERE ROWNUM<=1000
>order by primary_key desc
>
>or use more meaningfull criteria like
>WHERE employeenr < 12345 or
>WHERE UPPER(CITY) = 'AMSTERDAM'
>or whatever
>
>Arie Mars
>arie_at_pca-online.nl
>
>Steve Cholerton <stevechol_at_freeuk.com> schreef in berichtnieuws
>fgaptss9ej6ipq414mv2svj87t9dfrguq8_at_4ax.com...
>> Hi all
>> Can anybody advise me if there is a way to limit the number of rows
>> returned by a select statement, I have a select statement alsong the
>> following lines:
>>
>> select * from system_history order by primary_key desc
>>
>> I only want the last thousand rows ... is this possible ?
>> Many thanx
>> -Steve
>
Received on Mon Oct 09 2000 - 07:52:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US