a,b,c 三个字符的任意组合经转换后都变成a,b,c
create table test(nn varchar2(50));
insert into test select 'a,b,c' from dual;
--创建自定义函数
create or replace function getStr(nn varchar2)
return varchar2
as
v_name varchar2(50);
begin
select wm_concat(t.c) into v_name from (
select substr(replace(nn, ',', ''), level, 1) c
from dual
connect by level <= length(replace(nn, ',', ''))
order by c) t;
return v_name;
end;
SQL> select * from test t where t.nn=getStr('b,a,c');
NN
--------------------------------------------------
a,b,c