mysql update with regexp

后端 未结 3 1587
旧巷少年郎
旧巷少年郎 2021-01-11 16:28

I want to remove something from my table 1) 32) 121) 1000)... the format is number + )

3条回答
  •  心在旅途
    2021-01-11 16:54

    Finally, I use some php to solve this problem with a quickly method.

    for ($i=1; $i<=9999; $i++){
     $my_regex = $i.')';
     mysql_query("UPDATE articles SET title = REPLACE(title,'".$i."', '' ) where title like '%".$i."%'");
    }
    

提交回复
热议问题