例如,我有 2 个字符串:
- '来源:西贝尔;姓名:玛丽·简;性别:F;年龄:24;N;'
- '来源:西贝尔;姓名:玛丽;性别:F;年龄:24;N;'
我需要的结果是:
- 姓名:玛丽·简;
- 姓名:玛丽;
很可能我需要反转下面的代码
with cte1 as (
select 1 id, 'Source:Siebel; Name:Mary Jane; Gender:F; Age:24; N;' str from dual
union all
select 2 id, 'Source:Siebel; Name:Marie; Gender:F; Age:24; N;' str from dual
), cte2 as (
SELECT distinct id, trim(regexp_substr(str, '[^ ]+', 1, level)) str
FROM cte1 t
CONNECT BY instr(str, ' ', 1, level - 1) > 0
)
select distinct t1.str
from cte2 t1
join cte2 t2 on (t1.str = t2.str and t1.id != t2.id)
因为结果是 2 个字符串的相似性 [QueryResult]
我无法使用该过程,因为我需要此 SQL 脚本才能在 Oracle Fusion 中运行