Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: A VERY DIFFICULT QUERY
What if there are two closest salaries ?
(avg 45,500 - and 45,400/45,600 ?)
Look at working min(abs(avg(sal)-sal))
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
nooruddin wrote in message <7mkql9$ag6$1_at_news.vsnl.net.in>...
>Hi!
>
>I want a sql query for the following result:
>
>From a table containing salaries (say emp table)
>
>I want the salary which is closest to the average of all the
>salaries
>(it seems easy at first look, but I assure you its not the case)
>
>NOTE:The query should be an sql statement and not a pl/sql script.
>good luck..
>
>
>bye..
>
>
>
Received on Thu Jul 15 1999 - 01:03:07 CDT
![]() |
![]() |