Mysql 删除sql中以url开头的部分
我有一个MySQL表,我想删除包含字符串一部分的所有条目- 例如,在“description”字段中,许多条目可能具有如下字符串:Mysql 删除sql中以url开头的部分,mysql,Mysql,我有一个MySQL表,我想删除包含字符串一部分的所有条目- 例如,在“description”字段中,许多条目可能具有如下字符串: <strong><a href="http://www.example.com/1.html">.....</a></strong> <strong><a href="http://www.example.com/2.html">.....</a></strong> &l
<strong><a href="http://www.example.com/1.html">.....</a></strong>
<strong><a href="http://www.example.com/2.html">.....</a></strong>
<strong><a href="http://www.example.com/3.html">.....</a></strong>
...
...
名为test
的表。如何删除条目?尝试以下操作:
DELETE FROM test
WHERE description LIKE '%some_part_url%'
因此,通过您的示例,您可以尝试:
DELETE FROM test
WHERE description LIKE '%http://www.example.com/_.html%'
@快乐生活:我的回答对你有帮助吗?你解决问题了吗?