我有一些带有逗号分隔值的字段:
1,2,AA,4,Z
1,ZZ,44,A,1
1,44,33,AA,Z
4,2,Z,A,F
1.2,4,E,1,1
F,1,3.4,3,A
是否可以使用规则选择行:数字、数字、字符、任何值?
结果可以是:
1,2,AA,4,Z
4,2,Z,A,F
1.2,4,E,1,1
我正在尝试使用REGEXP_LIKE
:
with s as (
select '1,2,AA,4,Z' val from dual
union all
select '1,ZZ,44,A,1' val from dual
union all
select '1,44,33,AA,Z' val from dual
union all
select '4,2,Z,A,F' val from dual
union all
select '1.2,4,E,1,1' val from dual
union all
select 'F,1,3.4,3,A' val from dual
)
select val from s where REGEXP_LIKE(val, '(^|,)[[:digit:]](,|$)');