首页 > 解决方案 > 在 PostgresSQL 中替换特殊字符和 Unicode 字符

问题描述

我正在使用 PostgreSQL。表中的数据如下所示有''。我想用空值删除 '' 。

询问:

select 'Patriots Colony Family Monthly'

实际结果截图:

在此处输入图像描述

预期结果:

Abcd

标签: sqlpostgresqlpostgresql-9.4

解决方案


您可以使用regex_replace删除非字母数字字符

select regexp_replace(yourColumn, '[^[:alnum:]]', ' ', 'g')
from yourTable;

推荐阅读