【发布时间】:2019-09-26 04:40:50
【问题描述】:
商品价格为格式
999,99
999 - 1 ..4 digits
, - comma sign marks decimal point
99 - 2 digits after price
Postgres 9.1 表包含 char(50) 类型列。 此列可能包含以空格分隔的单独单词的价格。喜欢
Product 12,99 blue
Another product 4,59
This is third 124,39 item price
如何从选择语句中的描述中提取价格?对于这 3 行结果应该是
12,99
4,59
124,39
使用
x86_64-unknown-linux-gnu 上的 PostgreSQL 9.1.2,由 gcc-4.4.real (Debian 4.4.5-8) 4.4.5 编译,64 位
【问题讨论】:
-
不相关,但是:Postgres 9.1 是 no longer supported 您应该立即计划升级到受支持的版本(例如 11)。如果你不能这样做,你至少应该upgrade to the latest 9.1 minor version
-
我正在使用 Debian squueze,并且此升级在此操作系统中不可用。
标签: sql regex postgresql substring postgresql-9.1