Lee >I think the formula is just right - very clever. But is it possible to make >sure that col1, col2 and col3 are all from the same record? Different question, different answer I ween :-) SET @n = <?>; SELECT id, MIN( LEAST( ABS(@n-col1), LEAST( ABS(@n-col2), ABS(@n-cl3) ))) AS min FROM tbl GROUP BY id; PB ----- Lee Goddard wrote: Peter Brawley wrote: |
No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]