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)
select max(value)
from (select avg(value) avg_val from my_table
where account = 'my account' and timestamp between ... and ...) b, my_table a where a.account = 'my account'
or
select a.account, max(a.value)
from (select account, avg(value) avg_val from my_table
where timestamp between ... and ... group by account) b, my_table a where a.timestamp between ... and ...
-- Have a nice day Michel dsad <dsad_at_hotmail.com> a écrit dans le message : lXhd5.29262$Ra6.433828_at_zombie.newscene.com...Received on Wed Jul 19 2000 - 00:00:00 CDT
> 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?