mysql中替换行首字符

替换行首字符,而不替换字段中其它地方指定字符。

UPDATE table SET open_time = CONCAT('W', open_time) WHERE open_time REGEXP '^:';
UPDATE table SET open_time = REPLACE(open_time, 'W:', '') WHERE open_time REGEXP '^W:';

替换字段中所有位置的某一字符:

UPDATE table SET qq = REPLACE(qq, 'uin=', '') WHERE qq REGEXP '^uin=';

原文地址:https://www.cnblogs.com/timssd/p/6197528.html