本文介绍了如何在SQL Server中删除字符串的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 在我的表中有一个名为Remarks的列,最后有一个空格。我用过LTRIM,RTRIM&替换功能。这不是在开玩笑。建议任何其他方式删除空白区域。 我尝试过:In my table having a column named Remarks there is a blank space at the end. I used LTRIM,RTRIM & Replace function. It's not woking. Suggest any other ways to remove the blank space.What I have tried:update TableName set Remarks= LTRIM(RTRIM(Remarks))update TableName set Remarks= replace(Remarks,' ','')推荐答案SELECT ASCII(RIGHT(Remarks, 1)) AS LastCharAsciiCodeFROM TableName 现在,当你知道那里有什么样的字符时,你可以更新你的表格! 或 你可以替换所有不需要的字符Now, when you know what kind of char is there, you can update your table!OrYou can replace all unwanted charsupdate TableName set Remarks= REPLACE(REPLACE(REPLACE(Remarks,' ',''), CHR(10), ''), CHR(13), '') 祝你好运!Good luck! 这篇关于如何在SQL Server中删除字符串的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-20 14:02