I,如果content内容字段里只有1组
SUBSTRING(
content,
1,
INSTR(content,'') - 1),
--字符串2 : 字符串') )
'',到末尾
--字符串3 : 从
SUBSTRING(
content,
INSTR(content,'
)
II,如果content内容字段里有多组
推荐写PROCEDURE来解决
update `table` set `context` = substr(`context`,INSTR(`context`,"
"),INSTR(`context`,"")-INSTR(`context`,"
"))
方法1. 扩展 MySQL
让 MySQL 支持正则的用户自定义函数
https://launchpad.net/mysql-udf-regexp
(需要编译安装)
方法2. 用程序实现
参考:http://stackoverflow.com/questions/1384796/how-to-use-regexp-in-mysql-replace-commands