X-Original-To: pgsql-sql@postgresql.org Received: from t-9.net (unknown [64.246.36.43]) by postgresql.org (Postfix) with SMTP id 0E5FE4758E6 for ; Wed, 12 Mar 2003 18:31:34 -0500 (EST) Received: (qmail 28356 invoked by uid 0); 12 Mar 2003 21:32:32 -0000 Received: from localhost (HELO seahat.com) (127.0.0.1) by localhost with SMTP; 12 Mar 2003 21:32:32 -0000 Received: from 65.102.128.233 (SquirrelMail authenticated user snubber@seahat.com) by fordparts.com with HTTP; Wed, 12 Mar 2003 15:32:32 -0600 (CST) Message-ID: <10112.65.102.128.233.1047504752.squirrel@fordparts.com> Date: Wed, 12 Mar 2003 15:32:32 -0600 (CST) Subject: nearest match From: "Ryan" To: X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.8) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200303/323 X-Sequence-Number: 12362 I'm doing some work with part diagrams and server-side image maps. I want to store single point coordinates (x,y) for reference numbers in a table looking like: reference_number text, x int, y int My question is: How can I find the *nearest* match of some clicked on coordinates without specifying some arbitrary distance from the stored point? The more I think about this the more I am realizing it is probally not that hard, I just can't seem to grasp the answer right now. Thanks, Ryan