Sql字符串中的单个空格 [英] Single Space in Sql String

查看:145
本文介绍了Sql字符串中的单个空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





执行此查询时



Hi,

While executing this Query

select Replace(Replace(REPLACE('Overall experience is very positive.    thanks a lot.  regards  marine',' ','<>'),'><',''),'<>',' ')





我得到输出像





iam getting output like

Overall experience is very positive. thanks a lot. regards marine



同样的事情,iam在动态查询中执行




This same thing, iam executing in dynamic query

select Replace(Replace(REPLACE(FeedComments,' ','<>'),'><',''),'<>',' ')
from cbzfeedback where
FeedTrackno ='200051000'





我得到的输出就像





iam getting output like

Overall experience is very positive.        thanks a lot.  regards  marine



我需要输出就像在每个句子中有一个空格。请帮助我





[edit]已添加代码块 - OriginalGriff [/ edit]


I Need output like having one space in each sentence.kindly help me


[edit]Code block added - OriginalGriff[/edit]

推荐答案

我没有。

我创建了一个新表,通过复制'n'粘贴输入了您在上面显示的数据,然后运行您的确切查询。

我得到的正是我所期望的:

I don't.
I created a new table, entered exactly the data you show above via copy 'n' paste and then ran your exact query.
I got exactly what I expected:
Overall experience is very positive. thanks a lot. regards marine

I.e。所有空间都折叠到一个空格。

我建议你仔细查看输入的数据:你确定那些是空格字符,而不是制表符,或者& nbsp; 替换?

I.e. all spaces collapsed to a single space.
I suggest that you look at the data you are inputting a bit more closely: are you sure those are space characters, and not tabs, or &nbsp; replacements?


这篇关于Sql字符串中的单个空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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