modify int to float (mysql)
mysql, sql
Solution
ALTER TABLE `user` CHANGE rate intrate INTEGER;
ALTER TABLE `user` ADD rate float(5) NOT NULL DEFAULT 100;
UPDATE `user` SET rate=intrate;
ALTER TABLE `user` DROP intrate;
Problem
I'm trying to change datatype from INT to FLOAT in MySQL like this: ``` ALTER TABLE user MODIFY rate float(5) NOT NULL ``` But current data is droped. Is there any way to convent\save data from INT to FLOAT with SQL?