Q:

How to select the nearest value for two columns?

I need to retrieve the row with the nearest value using two columns.
the example below work for one column, but how about two columns?
order by abs(Column_X - myvalue_X) limit 1

I need to something like this:
order by abs(Column_X - myvalue_X),abs(Column_Y - myvalue_Y) limit 1 //wrong row

I´m using postgres with postgis

A:

I'm not sure with postgre syntax and what you really up to, but if you want to compare with 2 field,  how about using Euclidean distance 
Some thing like
order by ((Column_X - myvalue_X)*(Column_X - myvalue_X) + (Column_Y - myvalue_Y)*(Column_Y - myvalue_Y)) limit 1

