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: SQL question: getting the 10 most recent records

Re: SQL question: getting the 10 most recent records

From: Steve Bell <swayne.bell_at_sympatico.ca>
Date: Tue, 20 Mar 2001 17:05:27 GMT
Message-ID: <3AB78B26.D9B7CAE6@sympatico.ca>

Hi,

How about something like:

 select event_id, event_d
 from (select event_id,event_d from events order by event_d desc)  where rownum < 11

Juan Carlos Muro wrote:

> Hello. This is an SQL question.
>
> I have a table like this:
> create table events ( event_id number, event_d date );
>
> I want to get the 10 most recent events (by 'event_date' criteria) with a
> select. Is that possible? Something like:
> select <the 10 most recent> from events order by date desc;
>
> Can U help me?
>
> Thank you:
> J. Carlos Muro
Received on Tue Mar 20 2001 - 11:05:27 CST

Original text of this message

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