1

I have a table looks like below:

id  name  value    newColumn
============================
1   Joe     22     null
2   Derk    30     null

newColumn is a newly added column and I would like to update the data for each and every rows with a specific format: concat value and a specific string -CIF

End result should be something like below:

id  name  value    newColumn
============================
1   Joe     22     22-CIF
2   Derk    30     30-CIF

May I know how to construct such update query in mySQL?

1 Answer 1

2

This is a fairly basic update:

update table t
    set newColumn = concat(value, '-CIF');
Sign up to request clarification or add additional context in comments.

1 Comment

Well, I gave you almost a "code snippet is not enough" comment and a vtd :-)

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.