Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: select x max values
Dear Miran
I have got a solution of your problem
try this query
The following query assume that you have a table test_1 having field value.
SELECT VALUE FROM TEST_1
MINUS
SELECT VALUE FROM TEST_1
WHERE ROWNUM+n < (SELECT MAX(ROWNUM) FROM TEST_1)
ORDER BY VALUE DESC
where n=(number of max records)-1
Faheem
In article <iR5p5.678$jL4.3596_at_news.siol.net>,
"Miran" <aa_at_somone.si> wrote:
> My problem:
> I vant to select x max values from a table .
> For example
> My table is prices and it's values ar 10,11,12,13,14,15
> I want to select 3 max values form this table, and I dont want it
to be
> any function or procedure just select. I have a solution but it's
preate
> slow, so if you have any idea ...
>
> miran
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Aug 24 2000 - 09:26:22 CDT