Zergman Posted August 8, 2008 Share Posted August 8, 2008 I had a column in a table that was there since the beginning, but never used. Since then, i've decided to use it. It is just a varchar column, but currently was just NULL in all the entries. I need a way to change the NULL in each record to another value but would rather not have to go one by one and change each record. Im using phpmyadmin but couldn't find a way to do it easily. Would there be any issues if I just remove the column, add it back with the same name and just put "*" in the default value field? Would that work? Suggestions? Quote Link to comment Share on other sites More sharing options...
fenway Posted August 9, 2008 Share Posted August 9, 2008 Sure, why not a simple update statement? Quote Link to comment Share on other sites More sharing options...
Zergman Posted August 9, 2008 Author Share Posted August 9, 2008 kk, so if my table name was data and my column name was action, this should do the trick right? UPDATE data SET action = % WHERE action = NULL Quote Link to comment Share on other sites More sharing options...
Zergman Posted August 9, 2008 Author Share Posted August 9, 2008 That didn't seem to do the trick. Column is still empty. Looking through syntax and even using quotes didn't help. Only thing thats changed is the value NULL is gone. Column is not empty Quote Link to comment Share on other sites More sharing options...
Zergman Posted August 9, 2008 Author Share Posted August 9, 2008 Got it. Just realized I didn't need the WHERE part. Good to go, thanks fenway! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.