1

I'm trying to do this in mysql . How can I replace parts of a string in a column in MYSQL with 1000 records. Change all records form .JPG to .gif

eg. DC3444.JPG to DC3444.gif

2 Answers 2

7
update your_table 
set some_column = replace(some_column, '.JPG', '.gif')
Sign up to request clarification or add additional context in comments.

1 Comment

thanks man, worked. what about appending 0 to the start of a string of phone numbers in the records. eg. 222,334 to 0222,334
3
UPDATE table1 SET col1 = REPLACE(col1, '.JPG','.gif')

Use this as reference : http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_replace

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.