17,377
社区成员
发帖
与我相关
我的任务
分享
create or replace function testFunction
(
Str1 in varchar2,
Str2 in varchar2
) return varchar2 is
result varchar2(4000);
begin
select wm_concat(rn)
into result
from (select regexp_substr(Str1, '[^,]+', 1, rownum) rn
from dual
connect by rownum <= length(regexp_replace(Str1, '[^,]+')) + 1
intersect
select regexp_substr(Str2, '[^,]+', 1, rownum) rn
from dual
connect by rownum <= length(regexp_replace(Str2, '[^,]+')) + 1);
return result;
end testFunction;
select rn from(
select regexp_substr('31,32,33','[^,]+',1,rownum) rn
from dual connect by rownum<= length(regexp_replace('31,32,33','[^,]+'))+1
union all
select regexp_substr('22,32,33,42','[^,]+',1,rownum) rn
from dual connect by rownum<= length(regexp_replace('22,32,33,42','[^,]+'))+1
)
group by rn
having count(*)>1
select regexp_substr('31,32,33','[^,]+',1,rownum) rn
from dual connect by rownum<= length(regexp_replace('31,32,33','[^,]+'))+1
intersect
select regexp_substr('22,32,33,42','[^,]+',1,rownum) rn
from dual connect by rownum<= length(regexp_replace('22,32,33,42','[^,]+'))+1