--去除空白符
select regexp_replace(' a s d
', E'\\s+', ' ', 'g')
--去除首空格
select regexp_replace(' a b d ',E'(^\\s*)','','g')
--去除尾空格
select regexp_replace(' a b d ',E'(\\s*$)','','g')
--去除首尾空格
select regexp_replace(' a b d ',E'(^\\s*)|(\\s*$)','','g')
--去除首尾空格的函数
select trim(' a b d ')postgresql去掉字符串空白符以及首尾空格
去除字符串空白字符
最新推荐文章于 2024-01-18 21:33:18 发布
本文介绍使用SQL中的正则表达式函数来去除字符串中的各种空白字符,包括首空格、尾空格以及全部空白符。通过具体的SQL语句示范了如何实现这些功能。
1万+





