I have an sql table named Customers. In Customers I have the column Name.
I want to add in the column Name an space after 5 characters.
Example:
From the column "Name" with the content "name1234" i want add a space at the position 4 so that the result is "name 1234".
I have try it so but it dont work.
SELECT INSERT('Name',4,0, ' ')
FROM
Customers
How would you do it, please help.
What you want is to update your column values with a concatenation of the first part of the name followed by the space ' '
, followed by the rest of the name.
UPDATE Customers
SET name = CONCAT(SUBSTRING(name, 1, 5),
' ',
SUBSTRING(name, 6));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With