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 -> Re: A VERY DIFFICULT QUERY

Re: A VERY DIFFICULT QUERY

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 15 Jul 1999 07:03:07 +0100
Message-ID: <932018852.5071.1.nnrp-14.9e984b29@news.demon.co.uk>


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

Original text of this message

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