MySQL changing column types
October 27, 2006 /
Filed under: MySQL
Often in your database development work, you'll come across a situation where a particular column type no longer "fits" the type of data that needs to be stored in it. For example, let's say you're storing dollar amounts in an integer field, which can't hold decimal values. Later on, someone decides they need to store decimal values in that field, but can't. You need to convert that Rather than just changing the field type directly, and hoping that no data is lost or converted to something else - the best (and safest) way to accomplish this is to create a new field, and copy the old values over.
This query copies all of the values from Then, remove Sometimes it helps to only rename Comments/Mentions |
Recent Comments
Recent Music Listens
|
Dude, are you going to send me your resume or what? :)