mysql的replace函数

 

将单引号与双引号的替换,有时候在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
复制代码

 

 

 

 

 

 

 

 

 

 

 

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

posted @   igoodful  阅读(308)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示