From: Rick James Date: January 7 2013 6:42pm Subject: RE: Query Resulting error List-Archive: http://lists.mysql.com/mysql/228860 Message-Id: <582AFBFC517D194489EF570FE21694CF070937CD@GQ1-EX10-MB03.y.corp.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Don't use DOUBLE (or FLOAT) for monetary values. Use DECIMAL(...). Two de= cimal places ( ,2) suffices for most countries, but not all. DOUBLE values have been rounded when converted from decimal to binary. Mul= tiply creates another rounding. The end result may look the same when conv= erted from binary to decimal and displayed to only two decimal places, but = the underlying values may be "!=3D". > -----Original Message----- > From: Trimurthy [mailto:trimurthy@stripped] > Sent: Saturday, December 29, 2012 4:26 AM > To: mysql@stripped > Subject: Query Resulting error >=20 > hi, > i am working with mysql 5.1.36 and i wrote the following query. >=20 > select total,quantity*price from sales where total !=3D quantity*price > and salesid=3D122; >=20 > OUT PUT: >=20 > total quatity*price > 330.46 330.46 >=20 > here quantity is 15.5 and price is 21.32 >=20 > both the values and data types are double(total,quantity and price). > can > anyone tell me why this is happening. >=20 > Normal 0 false false false EN-US > X-NONE AR-SA >=20 >=20 >=20 >=20 >=20 >=20 > Thanks & Kind Regards, > TRIMURTHY >=20