SQL语句合并语句

【SQL】update时concat和replace的用法

 

①concat在原有的基础上追加内容

sql 语句:update 表名 set title=concat( title, '123') where id=1;

结果   id   title

    1     abc

更新后   1     abc123

②replace 替换原有字段内容里的值  

sql 语句:update 表名 set title=replace( title, 'abc', 'cdef') where id=1;

结果  id     title

    1   abcggg

更新后 1     cdefggg

posted @ 2018-09-05 16:34  get("新技能")  阅读(1688)  评论(0编辑  收藏  举报