Home > Database > Mysql Tutorial > body text

MySQl数据库字符串替换函数使用_MySQL

WBOY
Release: 2016-06-01 13:36:37
Original
883 people have browsed it

bitsCN.com

MySQl数据库字符串替换函数使用

 

需求:需要将数据表中一个字段的值里面的所有的  .   替换成  _  

 

原来的数据是  site.title  site.keywords  ....

 

替换后要为     site_title  site_keywords

 

使用的SQL语句如下:    

 

        update `setting` set ckey=replace(ckey, '.', '_');

 

setting是表名

 

ckey是字段名

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template