SQL 你如何去除 Oracle 中的前导空格?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1119456/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do you strip leading spaces in Oracle?
提问by larf311
I need to strip leading spaces from a column in Oracle. I've Googled but haven't found any answers except to write my own function which I'd like to avoid.
我需要从 Oracle 中的列中去除前导空格。我已经谷歌搜索但没有找到任何答案,除了编写我自己想要避免的函数。
What's the easiest way to accomplish this?
实现这一目标的最简单方法是什么?
回答by FerranB
回答by joe
回答by Jonathan
UPDATE table SET field = TRIM(field);
更新表 SET 字段 = TRIM(field);
回答by Reizorc
Update TABLE_NAME set FIELD_NAME = TRIM(COLUMN_NAME)
更新 TABLE_NAME 集 FIELD_NAME = TRIM(COLUMN_NAME)