sql - 在 PostgresSQL 中替换特殊字符和 Unicode 字符
问题描述
我正在使用 PostgreSQL。表中的数据如下所示有''。我想用空值删除 '' 。
询问:
select 'Patriots Colony Family Monthly'
实际结果截图:
预期结果:
Abcd
解决方案
您可以使用regex_replace
删除非字母数字字符
select regexp_replace(yourColumn, '[^[:alnum:]]', ' ', 'g')
from yourTable;
推荐阅读
- php - PHP数组唯一不能像预期的那样工作
- c# - 如何在 Blazor 中的页面之间传递对象
- python - PyQt6 如何动态调整 QGroupBox 的大小以适应内容?
- google-cloud-ml - 顶点 ai:ResourceExhausted 429 收到尾随元数据大小超过限制
- reactjs - 以与 `useMutation` 失败相同的方式使用 `useQuery` 钩子
- swift - 检索手动输入的数据 Firestore
- c++ - 定时器回调中的定时器 ID 与定义的定时器 ID 不同
- oracle - PL/SQL 如何创建字符串函数=
- regex - 带有 \g 的字符串的 Perl 正则表达式引发错误
- reactjs - 如何将默认道具设置为功能组件中所需的道具?