27

I have a field in the mysql database and I would like to insert text in front of all the values in that field.

I would like to add "F21 - " So the field would be "F21 - product name" instead of "product name"

I need a simple sql query

any ideas?

2
  • 1
    possible duplicate of stackoverflow.com/questions/680801/… Commented Feb 24, 2011 at 16:19
  • That question didn't have any of the search terms I used so I didn't find it. Thanks for posting. Commented Feb 24, 2011 at 16:34

1 Answer 1

65

Use CONCAT. Something like this:

UPDATE mytable SET myfield = CONCAT('f21 -', myfield)
Sign up to request clarification or add additional context in comments.

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.