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 -> Get the middle part of a result set

Get the middle part of a result set

From: Jens Riedel <JensRie_at_gmx.de>
Date: Tue, 18 Dec 2007 09:17:49 +0100
Message-ID: <5spe1dF1ak7ivU1@mid.individual.net>


Hi,

I have to following problem:

I get X rows from a statement, these are sorted by a certain column, let's say an numerical value.
Now I want to calculate the average of this numerical value, but the 10% with the lowest and the 10% with the highest value shall not be included in this calculation.
So for example, if I get 20 rows, I need the average of the value in rows 3 to 18.

Currently I solved this with a very complicated statement, but I don't know the built-in Oracle mathematical functions so I hope that there could be a way to do this with a better performance.

Thanks for any hints,

Jens Received on Tue Dec 18 2007 - 02:17:49 CST

Original text of this message

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