例如我的表中有一个字段叫VAL,其存储的数据如下
\000\000\999\00-1.jpg;$0-1.jpg;$0-2.jpg;$0-3.jpg;$0-4.jpg;$0-5.jpg;我要想提取';$'的出现次数,如何解决?超急,请各位大虾帮忙!谢谢
\000\000\999\00-1.jpg;$0-1.jpg;$0-2.jpg;$0-3.jpg;$0-4.jpg;$0-5.jpg;我要想提取';$'的出现次数,如何解决?超急,请各位大虾帮忙!谢谢
i number;
l number;
c number:=0;
begin
l:=length(str);
for i in 1..l loop
if(substr(str,i,1)='$') then
c:=c+1;
end if;
end loop;
return c;
end p1;
length(replace('\000\000\999\00-1.jpg;$0-1.jpg;$0-2.jpg;$0-3.jpg;$0-4.jpg;$0-5.jpg;','$',''))
from dual