MySQL Forums
Forum List  »  General

DATA TYPE DOUBLE
Posted by: Alain Terranova
Date: May 20, 2014 09:12AM

Hello,

I created this table:
CREATE TABLE `tbl_coupons_test` (
  `ID_COUPON` int(11) NOT NULL AUTO_INCREMENT,
  `Price_TVAC_01` double DEFAULT NULL,
  `purchase_price` double DEFAULT NULL,
  PRIMARY KEY (`ID_COUPON`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Here's his contained:
+-----------+---------------+----------------+
| ID_COUPON | price_tvac_01 | purchase_price |
+-----------+---------------+----------------+
|    600605 |        854.05 |         854.05 |
+-----------+---------------+----------------+

I would like to understand why this query return 1 record:
SELECT 
ID_COUPON, price_tvac_01, purchase_price
FROM
tbl_coupons_test
WHERE `ID_COUPON` = 600605 
AND `price_tvac_01` = 8.54049999999999950e+002;
+-----------+---------------+----------------+
| ID_COUPON | price_tvac_01 | purchase_price |
+-----------+---------------+----------------+
|    600605 |        854.05 |         854.05 |
+-----------+---------------+----------------+
1 row in set

And this one, return nothing:
SELECT 
ID_COUPON, price_tvac_01, purchase_price
FROM
tbl_coupons_test
WHERE `ID_COUPON` = 600605 
AND `purchase_price` = 8.54049999999999950e+002;

Empty set

Does somebody can give me an explaination?

Thanks in advance.

Alain

Options: ReplyQuote


Subject
Written By
Posted
DATA TYPE DOUBLE
May 20, 2014 09:12AM
May 20, 2014 03:15PM
May 20, 2014 05:58PM
May 21, 2014 08:08AM


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.