M
M
Mr. Smith2022-03-14 02:14:08
MySQL
Mr. Smith, 2022-03-14 02:14:08

How to add "prefix" to all text in a column in MySQL?

What sql query is needed to add the desired piece of text (prefix) to the entire column?
For example, there is a dle_post table and a url_post column , in which the data looks like this:

text-online.html
translate.html
hello-world.html

the task is to add the mx- prefix to all rows in the column, it should turn out like this:
mx-text-online.html
mx-translate.html
mx-hello world.html

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2022-03-14
@MrSS

update and concat().
https://stackoverflow.com/questions/13358923/sql-q...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question