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: Limitting result without ROWNUM

Re: Limitting result without ROWNUM

From: Dieter Noeth <dnoeth_at_gmx.de>
Date: Sat, 20 Jan 2007 17:29:32 +0100
Message-ID: <eotg29$evo$1@online.de>


Matthias Matker wrote:

> I have to limit the number of results without using ROWNUM or something
> like that. One hint was to use "JOIN".
>
> I have to select the 10 biggest persons from a table "persons"

As nobody used a "JOIN" yet, here it is:

SELECT t1.*
FROM t1 JOIN t1 AS t2 ON t1.HEIGHT <= t2.HEIGHT GROUP BY t1.ID, t1.FIRSTNAME,t1.LASTNAME, t1.HEIGHT, t1.AGE HAVING COUNT(*) <= 10

Don't ask about performance...

Dieter Received on Sat Jan 20 2007 - 10:29:32 CST

Original text of this message

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