我有一个包含超过 100 万条记录的表,在数据类型为 varchar(50)
的 2 列中,我的值类似于 23.23。
我需要将数据/值转换为 int
。
例如,23.23 到 23 通过去除 float 。
我在这个表上没有主键。
最佳答案
ALTER TABLE t1 CHANGE <column_name> <column_name> <type>
注意:您必须写两次列名 或者
ALTER TABLE t1 MODIFY <column_name> <type> ;
Reference
关于mysql - 从 'float' 转换为 'int' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22472771/