mysql: replace \ (backslash) in strings

前端 未结 6 833
执念已碎
执念已碎 2021-01-04 11:37

I am having the following problem:

I have a table T which has a column Name with names. The names have the following structure:

A\\\\B\\C

You can cre

6条回答
  •  无人及你
    2021-01-04 12:19

    Not exactly sure by what you mean but, this should work.

    select replace('A\\B\C', '\', '\\');
    

    It's basically going to replace \ whereever encountered with \\ :)

    Is this what you wanted?

提交回复
热议问题