日期:2014-05-17 浏览次数:20749 次
select chr(39)||replace('123;321;345;567',';',''',''')||chr(39) c1 from dual c1 -------------------------------- 1 '123','321','345','567'
------解决方案--------------------
create or replace function fun_test(i_str in varchar2) return varchar2 as begin return '''' || replace(i_str, ';', ''',''') || ''''; end; select fun_test('123;321;345;567') from dual; FUN_TEST('123;321;345;567') 1 '123','321','345','567'
------解决方案--------------------
select * from TB where id in( select regexp_substr('123;321;345;567', '[^;]+', 1, rownum) from dual connect by rownum <= length(regexp_replace('123;321;345;567', '[^;]'))+1)