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 -> getting the nearest number from a column

getting the nearest number from a column

From: matt <reflection77_at_gmail.com>
Date: 9 Apr 2007 00:50:10 -0700
Message-ID: <1176105010.255201.64370@l77g2000hsb.googlegroups.com>


I have a table with a column called salary. There are other columns as well but for the most part irrelevant to my problem. I want to be able to retrieve the closest salary value based on what a user inputs.

SAL
===
4000
3200
2900
2000
800

user input: 1450

I would like to get back "2000" as the closest value. I don't seem to see a useful operator such as "TOP" in mssql.

Any help would be appreciated.
Thanks Received on Mon Apr 09 2007 - 02:50:10 CDT

Original text of this message

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