problemas float
hola a todos!!
la cuestion es que tengo una tabla muy simple cuyo codigo es el siguiente
CREATE TABLE `TARIFA_ENCORDADO` (
`curso` int(4) unsigned NOT NULL,
`cordaje` varchar(20) NOT NULL,
`galga` float(5,2) unsigned NOT NULL,
`tipo` varchar(20) NOT NULL,
`precio` float(5,2) unsigned NOT NULL,
PRIMARY KEY (`curso`,`cordaje`,`galga`,`tipo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
la cuestion es que me esta dando numerosos problemas soy algo nuevo en mysql y creo que es un problema de los float ya que si realizo la consulta
mysql> select * from TARIFA_ENCORDADO where cordaje='rojo' and tipo='normal';
+-------+---------+-------+--------+--------+
| curso | cordaje | galga | tipo | precio |
+-------+---------+-------+--------+--------+
| 2006 | rojo | 1.20 | normal | 4.70 |
+-------+---------+-------+--------+--------+
1 row in set (0.00 sec)
me devuelve lo que le pido sin problemas, sin embargo si comparo un float, ya sea el 'precio' o la 'galga' me encuentro con el siguiente resultado
mysql> select * from TARIFA_ENCORDADO where galga = 1.20;
Empty set (0.00 sec)
no se muy bien como realiza la comparacion de float el motor de mysql, si alguien me pudiese ayudar lo agradeceria mucho ya que me urge bastante.
Un saludo y muchas gracias de antemano
PD: por cierto he probado a hacer la comparacion entrecomillando el 1.20, incluso poniendo coma en vez de punto y nada de nada.
Subject
Views
Written By
Posted
problemas float
9335
November 20, 2006 04:51AM
3559
November 20, 2006 06:27AM
3924
November 20, 2006 03:13PM
3294
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.