From: cjaouich@my-deja.com
Subject: Re: How to do a limited select without using a where clause?
Date: 2000/08/08
Message-ID: <8mp4of$pv$1@nnrp1.deja.com>#1/1
References: <8mmuo2$e5c$1@nnrp1.deja.com> <F4155D9F9AA4D111B9990020AFBA52D53E0D50@class06.ip061.sfi-software.com>
X-Http-Proxy: 1.1 x71.deja.com:80 (Squid/1.1.22) for client 24.200.243.178
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Tue Aug 08 14:16:50 2000 GMT
X-MyDeja-Info: XMYDJUIDcjaouich
Newsgroups: comp.databases.oracle.server
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)


Thanks for the response, but I can only use the order by in the last
component of the query (as per Ora doc)... Any other ideas? Thanks

-Cyril
------------------------------------
Opérations téléphonie IP - Vidéotron
Vidéotron  - IP Telephony Operations
------------------------------------

In article <F4155D9F9AA4D111B9990020AFBA52D53E0D50@class06.ip061.sfi-
software.com>,
  "Mark" <markag@wonderstats.com> wrote:
> Do something like this:
>
> SELECT * FROM
>     (SELECT * FROM YOUR_TABLE
>      WHERE MYCOL = MYCRITERIA
>       ORDER BY MYORDER)
>     WHERE ROWNUM <= 20;
>
> The inner select returns your data set, the outer select limits the
 number
> of rows.
>
> <cjaouich@my-deja.com> wrote in message news:8mmuo2
 $e5c$1@nnrp1.deja.com...
> > Hi, if I am not posting to the right forum, please point me in the
> > right direction.
> >
> > I am trying to do a SQL select that is using an order by clause. The
> > statement return 100+ rows, but I only want the first 5 rows of the
> > order by clause without specifying a limit or a where clause. Is
 this
> > possible?
> >
> > ie:
> >
> > select date, mac, fqdn, dhcp_ip from clients where mac like =
 '0000%'
> > order by date;
> >
> > this return me a list of 100+ rows, but I want only the last 5, and
 I
> > cannot use the date as a limit.
> >
> > Thanks in advance
> >
> > Cyril Jaouich
> > ------------------------------------
> > Opérations téléphonie IP - Vidéotron
> > Vidéotron  - IP Telephony Operations
> > ------------------------------------
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


