Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is it possible to have a max function in SQL that exlcudes outliners(values 20x average)
try this
select a.account, max(a.amount)
from table a, (select account, avg(amount) check1 from table where somedate between start and end group by acount) b where a.somedate between start and end and a.account =b.account and a.amount between (b.check1 * 0.8) and (b.check1 *1.2)group by a.account
HTH Conan
dsad wrote in message ...
>we need to get max of a value for an account over a time period, but we
want
>to exclude any values that are 20x greater or less than average for that
>account over the period
>
>any ideas?
Received on Wed Jul 19 2000 - 00:00:00 CDT
![]() |
![]() |