Is it possible to cast a DECIMAL to DOUBLE in MySQL?
问题 I know all the numerical implications, that is, the possible rounding issues inherent to floating point formats, but in my case I have DECIMAL columns in MySQL that I want to convert to DOUBLE straight in the MySQL query rather than down stream. Could anyone help? 回答1: SELECT my_decimal_field + 0E0 FROM my_table 回答2: It seems not possible to cast it to DOUBLE which brings problems if you do calculations and for example want to ROUND() a DECIMAL 12,2 in the third digit. Using ROUND(foo * bar,2