#1265 – Data truncated for column

  Kiến thức lập trình

I have a table with a b_mag field that contains about 13000 records which is VARCHAR but I need FLOAT because I have to sort them numerically and do other things.
The values that b_mag contains are all of the type 12.45, 9.5, 10.5 and some empty fields.
I created a new b_mag_num field of type FLOAT and ran this query:

UPDATE `vega_ngc_ic_messier_catalog` SET `b_mag_num` = `b_mag` WHERE `ID`=`ID`

but I get this error:

#1265 - Data truncated for column 'b_mag_num' at row 8

I don’t understand why the data is truncated, FLOAT can contain the type of data that is passed to it.

Thanks to anyone who can help me.

1

LEAVE A COMMENT