Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> getting the nearest number from a column
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