将字符串中的单引号替换为另一个字符串 SQL

时间:2021-01-08 18:03:19

标签: 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')

给我“附近的语法不正确”。

2 个答案:

答案 0 :(得分:3)

在字符串 ' 中引用 ''

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

答案 1 :(得分:2)

你需要在字符串中加双单引号:

  replace(c1,
          '''there it is'' is what she said'
          '''there it is plus two'' is what she said'
         )
相关问题