【问题标题】:Delete from wp_posts where (string starts with <a href="consistent-inconsistent"></a>)从 wp_posts 中删除(字符串以 <a href="consistent-inconsistent"></a> 开头)
【发布时间】:2013-09-20 13:26:44
【问题描述】:

基本上,我有数以千计的链接都包含搜索网站。 (xxxxxx 是不同的文本)。

如果我可以去掉开始锚标记,我可以进去删除结束标记的每个实例。

非常感谢任何帮助或提示。

【问题讨论】:

    标签: mysql wordpress wildcard


    【解决方案1】:

    您正在寻找delete from table where left(string, 38)='&lt;a href=“consistent-inconsistent”&gt;&lt;/a&gt;'

    如果你想截断那部分字符串,只需使用 substring_index 或替换

    SELECT SUBSTRING_INDEX(string, 'leading string', -1) 删除前导字符串

    SELECT REPLACE('string', 'part you want to replace', 'what to replace with') 用某些东西替换子字符串。替换为“”删除。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-20
      • 1970-01-01
      • 2011-09-19
      • 1970-01-01
      • 2011-08-13
      • 1970-01-01
      • 1970-01-01
      • 2015-06-15
      相关资源
      最近更新 更多