I have a requirement where at first I need to remove all space from a string, then put a space after 3 characters started from right.
I have removed the spaces but putting space after certain characters is not happening.
IE:
AX1098
AX1 098
SELECT INSERT('AX1098', 4, 0, ' ');
http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_insert
To update all rows:
UPDATE YOURTABLE
SET YOURCOL = INSERT(YOURCOL, 4, 0, ' ');
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