How to add text at the beginning and end of a string?
For example, I'd like to add <p style="display:inline;">
at start and </p>
at the end of all rows in column answer
in table question_answer
.
How to add text at the beginning and end of a string?
For example, I'd like to add <p style="display:inline;">
at start and </p>
at the end of all rows in column answer
in table question_answer
.
You can use the CONCAT
function.
To concatenate the before information of the current value, you can use:
UPDATE question_answer SET answer = CONCAT('<p style="display:inline;">', answer );
To add information after of the current value:
UPDATE question_answer SET answer = CONCAT(answer, '</p>');