From: Joerg Bruehe Date: October 25 2010 6:23pm Subject: Re: Query precision issue List-Archive: http://lists.mysql.com/mysql/223443 Message-Id: <4CC5CB38.8040803@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Sairam, sorry to be so blunt, and please don't feel offended: Sairam Krishnamurthy wrote: > [[...]] >=20 > Can somebody help me to find out the problem? I can very well truncate > the trailing zeros when querying, but I am interested in finding why an= > additional trailing zero returns an empty set. You have not understood the concept of floating point data and of their binary representation. For a starter, please try to write the *exact* value 1.0/3.0 with a finite number of decimal digits. A basic paper on this was available here: http://cch.loria.fr/documentation/IEEE754/ACM/goldberg.pdf Any attempt to solve your problem by giving a different number of trailing zeros is bound to fail. You best drop the approach of using equality predicates for floating point data, it will not work in the general case. J=F6rg --=20 Joerg Bruehe, MySQL Build Team, joerg.bruehe@stripped (+49 30) 417 01 487 ORACLE Deutschland B.V. & Co. KG, Komturstrasse 18a, D-12099 Berlin Geschaeftsfuehrer: Juergen Kunz, Marcel v.d. Molen, Alexander v.d. Ven Amtsgericht Muenchen: HRA 95603