example
I have the following string values
'[123] X'
'[123] Y'
'[123] Z'
...
I want to bulk change them to
'X [123]'
'Y [123]'
'Z [123]'
...
X, Y, Z are completely random not sequential
[123] is constant
I think the example above explains it all
2
Answers
I would use the
REPLACE()
function.First remove the [123] from the string. Then add it again at the end of the string:
MySQL regex query:
Alternative:
Little bit complex:
Sample Output: db<>fiddle