SQL: search of nearest in 2d square and circle

sfamledshr

New Member
I have a table: pointsit has 2 filds: X, Yeach row represents a dot on 2d fieldI want to be capable of performing search of dots with in some radius R like
yuamC.png
and is square with side A like
McSAq.png
BTW: I use PHP to access my DB.My main point is to get nearest to center of figure point as first result in the quqe like
YkYnA.png
How to do such thing in SQL?
 
Back
Top