Hi guys,
I created table fielded double(16,2) type. But I'm cann't get summary this field.
SELECT SUM(Value) FROM Result
Result: 0.00
What's wrong? Please help me.
Thanx for your advice.
are you running this from the commandline or though PHP?
through PHP
In that case, how are you reading the result?
try adding an alias to the value:
SELECT sum(bla) AS total FROM table;
and fetch the results like this: $row = mysql_fetch_array($result, MYSQL_ASSOC); echo $row['total'];
Thanks for your advice.
This code is right. I tested that MySQL's SUM function is not running in FLOAT and DOUBLE type. But in decimal type SUM function is running. I think maybe it is MySQL's bug.