izbryte Posted March 29, 2008 Share Posted March 29, 2008 Hi! I have a column in my DB where all the fields are ID numbers. I'd like to add a word to the beginning of each field. So, for example, right now it looks like this: 1234 2345 3456 4567 but I'd like it to look like this: myword1234 myword2345 myword3456 myword4567 It's the same word for every column. Is there an easy way to do this? Thanks! Quote Link to comment Share on other sites More sharing options...
sholdowa Posted March 29, 2008 Share Posted March 29, 2008 1. Make sure the column is notan integer type, but is varchar and long enough 2. update table set column = concat("myword", column); Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 30, 2008 Share Posted March 30, 2008 The Integer should be all that is in the database if you need to apply a word to it for other purposes (like presentation or key merging) you can do it via CONCAT in a query. 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.