从 Longtext 到 decimal(17,4) 的转换

Conversion from Longtext to decimal(17,4)

我一直在网上寻找它的解决方案,但找不到解决办法。 例如,我有一个名为 temp 的 table:

incassoid  productid  productamount  amount    
---------  ---------  -------------  -------  
    1          1      50.00          50.0000                  
    2          1      40.00          40.0000                    
    3          1      50.00          50.0000    

其中productamount的类型是longtext,我想转换成Decimal(17,4),到目前为止我试过:

ALTER TABLE temp ALTER COLUMN productamount Decimal(17,4);

但是它给我一个错误:

 Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Decimal(17,4)' at line 1

我不知道出了什么问题,有人可以帮忙吗.....

谢谢

对 MySQL

使用 MODIFY 关键字
ALTER TABLE temp MODIFY COLUMN productamount Decimal(17,4);