>Is there an efficient way to find the closest numerical value, across
>three columns? I do not know if there is a way to find it across one.


Not sure about efficiency, but if the criterion number is @n, do you mean ...

SELECT LEAST( ABS(MIN(@n-col1)),
              LEAST( ABS(MIN(@n-col2)),
                     ABS(MIN(@n-col3))
                   )
            )
FROM ...


?

PB

-----

Lee Goddard wrote:
Is there an efficient way to find the closest numerical value, across three columns? I do not know if there is a way to find it across one.

I thought about plotting the values in a geometric space, but that would seem to require more dimensions that the server can handle. I thought about using a Kohonen network, but I would prefer to use MySQL.

Many thanks in anticipation
Lee

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.5/403 - Release Date: 7/28/2006

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to