'Changing Column in MySQL from int to double?
Basically, I currently have a column in a MySQL table, which is an int.
I'd like to change that to double. I've searched the web, but all it came up with was conversion upon getting the values from the column (like converting some date to Date), but that's not what I mean.
I'm guessing it's something with Alter Table, and I looked that up on the MySQL dev page, but could not find what I was looking for.
Solution 1:[1]
You're right that you need to use ALTER TABLE. The command will look something like this:
ALTER TABLE tablename MODIFY COLUMN columnname DOUBLE;
Solution 2:[2]
My SQL is Non-case sensitive*
You can use :
ALTER or alter, TABLE or table, COLUMN or column, DOUBLE or double
Right now , you follow this format
ALTER TABLE table_name MODIFY COLUMN column_name DOUBLE;
I hope, it will be helpful for you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | eggyal |
| Solution 2 |
