<span>mysql的replace函数</span>

 

将单引号与双引号的替换,有时候在json处理中需要:

 

dba@xxx ((none)) > select replace('xxxx"12345"677777','\"',"'");
+---------------------------------------+
| replace('xxxx"12345"677777','\"',"'") |
+---------------------------------------+
| xxxx'12345'677777                     |
+---------------------------------------+
1 row in set (0.07 sec)

Thu Nov 12 17:14:03 2020
dba@xxx ((none)) > select replace("xxxx'12345'677777","'",'\"');
+---------------------------------------+
| replace("xxxx'12345'677777","'",'\"') |
+---------------------------------------+
| xxxx"12345"677777                     |
+---------------------------------------+
1 row in set (0.07 sec)

Thu Nov 12 17:15:44 2020

 

 

 

 

 

 

 

 

 

 

 

###################################

全部评论

相关推荐

不愿透露姓名的神秘牛友
11-27 10:21
点赞 评论 收藏
分享
耀孝女:就是你排序挂了
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务