RE: Query Resulting error

2013-01-07 Thread Rick James
Don't use DOUBLE (or FLOAT) for monetary values.  Use DECIMAL(...).  Two 
decimal places ( ,2) suffices for most countries, but not all.

DOUBLE values have been rounded when converted from decimal to binary.  
Multiply creates another rounding.  The end result may look the same when 
converted from binary to decimal and displayed to only two decimal places, but 
the underlying values may be !=.

 -Original Message-
 From: Trimurthy [mailto:trimur...@tulassi.com]
 Sent: Saturday, December 29, 2012 4:26 AM
 To: mysql@lists.mysql.com
 Subject: Query Resulting error
 
 hi,
   i am working with mysql 5.1.36 and i wrote the following query.
 
select total,quantity*price from sales where total != quantity*price
 and salesid=122;
 
OUT PUT:
 
totalquatity*price
   330.46   330.46
 
 here quantity is 15.5 and price is 21.32
 
 both the values and data types are double(total,quantity and price).
 can
 anyone tell me why this is happening.
 
  Normal   0   false   false   false  EN-US
 X-NONE   AR-SA
 
 
 
 
 
 
 Thanks  Kind Regards,
 TRIMURTHY
 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



RE: questions about group_concat_max_len

2013-01-07 Thread Rick James
I suspect, without knowing for sure, that the server will preallocate the 16MB 
(or whatever) and then proceed to fill it in.  Such a malloc is not costly, and 
not risky (unless you have thousands of threads doing the same thing at the 
same time).

Who cares?  If GROUP_CONCAT() is what you need, then pay whatever the price is.

If you hit a MySQL limit, you are probably mis-using MySQL.

 -Original Message-
 From: Paul Halliday [mailto:paul.halli...@gmail.com]
 Sent: Friday, January 04, 2013 5:12 AM
 To: mysql mailing list
 Subject: questions about group_concat_max_len
 
 Are there performance considerations if this value is set really high,
 say big enough to fit into max_allowed_packet? Does it matter?
 
 Thanks.
 
 --
 Paul Halliday
 http://www.pintumbler.org/
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql