如何用SQL字符串中的','替换。 [英] How do I replace , with ',' in SQL string.

查看:104
本文介绍了如何用SQL字符串中的','替换。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有包含abc,pqr的字符串。现在我想用','代替。像abc','pqr。请给出一些解决方案

解决方案

  SELECT  REPLACE(  testing,逗号'' ,'' '','''); 


使用下面的代码



选择替换(sur_remarks,',',Char( 39)+','+ char(39))来自 ttuser



其中sur_remarks是列名,ttuser是表名称

I have string which contains abc,pqr. Now I want to replace the , with ','. Like abc','pqr. Please give some solution

解决方案

SELECT REPLACE('testing,comma',',',''',''');


use below code

select replace(sur_remarks,',',Char(39)+','+char(39)) from ttuser

where sur_remarks is column name and ttuser is table name.


这篇关于如何用SQL字符串中的','替换。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆