这有效 select replace('string with space',' ','')
并返回 stringwithspace。
这不起作用 select replace('8 190',' ','')
,它返回 8 190
这与 select replace('8 190',' ','')
返回 8 190 相同。
为什么它不起作用?
最佳答案
string_pattern需要包含空格 
的ASCII码160
SELECT REPLACE('8 190', char(160),'')
关于SQL Server : How to replace whitespaces( , ASCII)在带数字的字符串中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27925182/