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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Hod do I select the last 100 records of a Table.

Re: Hod do I select the last 100 records of a Table.

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Tue, 22 Jun 1999 12:55:09 +0100
Message-ID: <j2S6vLAdm3b3EwL3@ahardy.demon.co.uk>


In article <376F6B47.5B097F0_at_bsolved.com>, Glen Gray <gleng_at_bsolved.com> writes
>I know it sounds like a simple request but I can't get it to work.
>
>If I do :
>
>select * from table_name where rownum<=100 order by recordid desc

The WHERE clause is effective before the ORDER BY.

That is, you are asking the database to give you any 100 records from your table and then order those by the recordid.

Andy
>
>I get the first 100 records back in reverse order. I haven't been able
>to do a select into #tmp_table either. I need to get this working fairly
>quickly so any help would be greatly appreciated.
>
>It's Oracle Server 8.0.3 running on NT Server.
>
>Thanks in advance.
>
>Glen Gray
>

--
Andy Hardy. PGP key available on request


Received on Tue Jun 22 1999 - 06:55:09 CDT

Original text of this message

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