本文介绍了如何在MYSQL中使用查询删除2个字符之间的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中的字段称为description,其中包含类似以下内容的文本

I have table with field called description which contains text like following

|Description                              |
|-----------------------------------------|
|This is a text <a>blah</a> <br/> <img /> |
|This is <b>second</b> <a>row</a>         |

我想删除"< "和"> "

|Description                              |
|-----------------------------------------|
|This is a text blah                      |
|This is second row                       |

无论如何,我可以使用MYSQL查询来实现这一点.我目前无法使用存储过程,因为我没有权限.我已请求访问使用存储过程,但这需要一些时间,我必须紧急完成这一点.

Is there anyway I can achieve this using MYSQL query. I cant currently use Stored procedure for the same as I don't have rights. I have requested for the access to use stored procedure but that will take some time and I have to finish this bit urgently.

谢谢.

更新:我的问题类似于从文本字符串中删除2个字符之间的字符串,但我希望在MYSQL查询中完成.

Update: my question is similar to Remove string between 2 characters from text string but I want it to be done in MYSQL query.

推荐答案

总之,您不能,需要像PHP这样的更高级的语言.您的SQL查询不是执行字符串操作的地方.

In short, you can't, you need a more advanced language like PHP. Your SQL query is not the place to be doing string manipulation.

这篇关于如何在MYSQL中使用查询删除2个字符之间的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 11:43