hao0089 发表于 2016-10-21 02:52:37

mysql 更新某个字段的部分内容

  语法:update table_name t set t.row_name=replace(t.row_name,'old_value','new_value')
  注:table_name   表名;   row_name  被更新的列名;   old_value  要被更新的值; new_value 更新的新值
  例如:将content里的www,替换为'http://file.resources.tt.515best.com的语句如下:
  
  update tl_lanb11_content t set t.content=replace(t.content,'www','http://file.resources.tt.515best.com')  where  t.nb_content_id=49976
  
页: [1]
查看完整版本: mysql 更新某个字段的部分内容