<p><img src=\"/d/file/meinv/2013-12-28/2a7f0db6958dc19faf4de326f49fa918.jpg\" alt=\"image.jpg\" width=\"497\" height=\"673\" />&nbsp;</p>以上是newstext字段中的内容,将所有img标签中的width和height属性删除。得到如下结果<p><img src=\"/d/file/meinv/2013-12-28/2a7f0db6958dc19faf4de326f49fa918.jpg\" alt=\"image.jpg\" />&nbsp;</p>

解决方案 »

  1.   

    CONCAT(SUBSTR(val,0,INSTR(val, 'width'), SUBSTR(val, INSTR(val, '/>') )
    类似这样
      

  2.   

    UPDATE tablemname SET newstext = CONCAT(LEFT(newstext, INSTR(newstext, ' width=')), SUBSTR(newstext, INSTR(newstext, '/>')))
      

  3.   

    update 表名  set newstext=replace(newstext,'被替换内容','替换后的内容')