首页 > 解决方案 > 用另一个字符串 SQL 替换其中带有单引号的字符串

问题描述

我在一列中有一个值(称为列 c1),如下所示:

'there it is' is what she said

我想将其替换为:

'there it is plus two' is what she said

但过得很艰难。

Using replace(c1
    , ''there it is' is what she said'
    , ''there it is plus two' is what she said')

给我“那里的语法不正确”。

标签: sql

解决方案


引用'内部字符串''

replace(c1
    , '''there it is'' is what she said'
    , '''there it is plus two'' is what she said')

推荐阅读