MySQL Forums
Forum List  »  Spanish

Re: problemas float
Posted by: William Chiquito
Date: November 20, 2006 03:13PM

Hola jose,

Como bien indica Faustino, un cambio de tipo de dato es lo recomendable en este caso.

La documentación indica:

"5. If you are comparing FLOAT or DOUBLE columns with numbers that have decimals, you can't use equality (=) comparisons. This problem is common in most computer languages because not all floating-point values can be stored with exact precision. In some cases, changing the FLOAT to a DOUBLE fixes this. See Sección A.5.8, “Problemas con comparaciones en Floating-Point”." - http://dev.mysql.com/doc/refman/5.0/en/no-matching-rows.html

Ahora bien si deseas mantener tu columna como FLOAT puedes hacer un CONVERT. algo como:

select * from TARIFA_ENCORDADO where CONVERT(galga, DECIMAL) = 1.20;

Options: ReplyQuote


Subject
Views
Written By
Posted
8865
November 20, 2006 04:51AM
3339
November 20, 2006 06:27AM
Re: problemas float
3610
November 20, 2006 03:13PM
3069
November 20, 2006 04:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.