我在 Oracle SQL 中有查询:
select town_name,
regexp_substr(town_name, '[^A,]+', 1, 1) as c1,
regexp_substr(town_name, '[^A,]+', 1, 2) as c2,
regexp_substr(town_name, '[^A,]+', 1, rownum) as c_rownum,
rownum
from epr_towns
结果的前 2 行是:
VALGANNA V LG V 1
VARANO BORGHI V R R 2
我需要在 PostgreSQL 上获得相同的结果(对于带有 的行regexp_substr(town_name, '[^A,]+', 1, rownum) as c_rownum
),但我不知道如何。你可以帮帮我吗?谢谢。