create or replace function get(p_b in varchar2) return number is
cursor t_sor is select list from A; begin for v_sor in t_sor loop if substr(v_sor.list,1,1)=p_b then return(1); elsif substr(v_sor.list,instr(v_sor.list,',')+1,1)=p_b then return(1); elsif substr(v_sor.list,instr(v_sor.list,',',1,2)+1,1)=p_b then return(1); elsif substr(v_sor.list,instr(v_sor.list,',',1,3)+1,1)=p_b then return(1); else return(null); end if; end get; /select id from a where get(b)=1;
cursor t_sor is
select list from A;
begin
for v_sor in t_sor loop
if substr(v_sor.list,1,1)=p_b then
return(1);
elsif substr(v_sor.list,instr(v_sor.list,',')+1,1)=p_b then
return(1);
elsif substr(v_sor.list,instr(v_sor.list,',',1,2)+1,1)=p_b then
return(1);
elsif substr(v_sor.list,instr(v_sor.list,',',1,3)+1,1)=p_b then
return(1);
else
return(null);
end if;
end get;
/select id from a where get(b)=1;
enf if;
end loop;--多加此语句