在亚洲语言中使用split_part分割字符串 [英] Split string with split_part in Asian language

查看:132
本文介绍了在亚洲语言中使用split_part分割字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一栏中有亚洲地址。我想提取子字符串直到第一个空格。但是,这在这里不起作用。我怀疑这与亚洲语言有关,但我既不为什么也不如何处理这个问题。

I have a column with Asian addresses. I want to extract the substring until the first whitespace. However, this does not work here. My suspicion is that it has to do with the Asian language, but I do not why nor how to deal with this issue.

这是代码:

select address, split_part(address, ' ', 1) from asian

示例性输出(未发生分裂!)。如您所见,有空格。

Exemplary output (no splitting has happened!). As you can see there are spaces.

address
"千葉県富津市新富20−1 新日本製鐵株式会社 技術開発本部内"
split_part
"千葉県富津市新富20−1 新日本製鐵株式会社 技術開発本部内"


推荐答案

您可以破解表意空间 chr(),例如:

t=# select split_part('千葉県富津市新富20−1 新日本製鐵株式会社 技術開発本部内',chr(12288),1);
       split_part
-------------------------
 千葉県富津市新富20−1
(1 row)

t=# select split_part('千葉県富津市新富20−1 新日本製鐵株式会社 技術開発本部内',chr(12288),2);
     split_part
--------------------
 新日本製鐵株式会社
(1 row)

这篇关于在亚洲语言中使用split_part分割字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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