mysql替换斜杠,mysql:替换字符串中的(反斜杠)

更新时间:2023-07-20 11:25:04 阅读: 评论:0

mysql替换斜杠,mysql:替换字符串中的(反斜杠)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 create on yourlf like this:
create table T ( Name varchar(10));
inrt into T values ('A\\\\B\\C');
教研组长lect * from T;
仰漂
Now if I do this:
lect Name from T where Name = 'A\\B\C';
mid函数的使用方法
That doesn't work, I need to escape the \ (backslash):
lect Name from T where Name = 'A\\\\B\\C';
Fine.
阅江楼景区But how do I do this automatically to a string Name?
Something like the following won't do it:
lect replace('A\\B\C', '\\', '\\\\');
I get: A\\\BC
Any suggestions?
Many thanks in advance.
解决⽅案
You have to u "verbatim string".After using that string your Replace function will
look like this
Replace(@"\", @"\\")
I hope it will help for you.

本文发布于:2023-07-20 11:25:04,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1106780.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:替换   山西   考试网   招生   入口   方法
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图