Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: query problem : urgent!
On 30-Apr-98 15:41:43 Koen Serry & Bart Van Daele wrote:
>hi,
>student needs help
>how can i select the 20 biggest files from my table????????
>table files
>-------------
>naam varchar2(50)
>size integer
Hello Bart,
try this
select * from files a
where 20<(select count(*) from files b
where a.size<b.size)
order by size desc;
Perhaps you will have to replace '<' by '<=' or '>' by '>='. This is a quite straight forward approach but it should work.
Hope that helps,
Lothar
--
Lothar Armbrüster | lothar.armbruester_at_rheingau.netsurf.de Schulstr. 12 | lothar.armbruester_at_t-online.de D-65375 Oestrich-Winkel |Received on Mon May 04 1998 - 15:20:05 CDT