用法:
INSERT (ori_string, in_pos, length, new_string)
MySQL INSERT() 在一个字符串中插入新的字符串;同时移除指定长度的字符串。如果新字符串的参数为null,函数返回null
举例:
1.移除phpff
mysql> select insert('www.phpff.com',5,5,'163');
+———————————–+
| insert('www.phpff.com',5,5,'163') |
+———————————–+
| www.163.com |
+———————————–+
1 row in set
2.移除0个字符
mysql> select insert('www.phpff.com',5,0,'163');
+———————————–+
| insert('www.phpff.com',5,0,'163') |
+———————————–+
| www.163phpff.com |
+———————————–+
1 row in set
3.新字符串为null
mysql> select insert('www.phpff.com',5,5,null);
+———————————-+
| insert('www.phpff.com',5,5,null) |
+———————————-+
| NULL |
+———————————-+
1 row in set