Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Limitting result without ROWNUM
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
![]() |
![]() |