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
すべての行を更新するには:
UPDATE YOURTABLE
SET YOURCOL = INSERT(YOURCOL, 4, 0, ' ');
文字列の長さが異なる場合:
update t set F = INSERT(F,LENGTH(F)-2,0,' ');