SQL: REPLACE replace string

grammar

REPLACE(str,from_str,to_str)

example

Remove contentspaces from the field

update `tb_news` set `content` = replace(`content`,' ','') where id = 1;

reference article

  1. Usage of replace in mySQL

Guess you like

Origin blog.csdn.net/mouday/article/details/131828731