select regexp_substr('11;22;33;44;55;','[^;]+',1,rownum)
from dual connect by rownum<=5
使用,pd_types为 【,11,21,22,23,44,31,32,】这种类型, 需要匹配为 【11,12】或者【31,32,33,44】
select *
from MMT_34_BRAND, (select level l_count from dual connect by level <= 20)
where regexp_substr(t.pd_types,'[^,]+',1,l_count )
in (11,12)
本文介绍如何使用SQL中的正则表达式函数regexp_substr进行数据解析。通过具体示例展示如何从包含特定分隔符的字符串中抽取指定模式的数据,并将其用于数据库查询。
1万+

被折叠的 条评论
为什么被折叠?



