Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: getting the nearest number from a column

Re: getting the nearest number from a column

From: <jarl_at_mimer.com>
Date: 11 Apr 2007 02:34:20 -0700
Message-ID: <1176284060.687971.61810@o5g2000hsb.googlegroups.com>


Oops, I just realized the GROUP BY clause is redundant. Try this instead:

SELECT sal FROM saltable
WHERE ABS(1450 - sal) =
  (SELECT MIN(ABS(1450 - sal)) FROM saltable);

/Jarl Received on Wed Apr 11 2007 - 04:34:20 CDT

Original text of this message

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