首页 > 解决方案 > 如何连接具有“。”的值 在PostgreSQL?

问题描述


我有这张桌子


1.3.6.7.8
22.6.99.9
1-3-6-7-9
1 3 6 7 9


在我请求 postgresql 之后,我想要这个


13678 226999
13679
13679

标签: sqldatabasepostgresql-9.1

解决方案


使用regexp_replace()

select replace(col, '[^0-9]', '', 'g')

是一个 db<>fiddle。


推荐阅读