oracle 只取字串中的數字

2021-04-28 19:48:42 字數 454 閱讀 2605

create or replace  function getnumber(str varchar2) return varchar2  is

rstr varchar2(4000);

begin

if str is null then

return null;

else

rstr := '';

for i in 1 .. length(str) loop

if (ascii(substr(str, i, 1)) between 48 and 57) or

(substr(str, i, 1) = '.') then

rstr := rstr || substr(str, i, 1);

end if;

end loop;

return rstr;

end if;

end ;

ASP 只擷取字串的數字

function regexptestsp str,pat dim r,match,matches set r new regexp r.pattern pat r.ignorecase false r.global true set matches r.execute str for each m...

ORACLE獲取字串中數字部分

select translate 1212中國2323 0123456789 1212中國2323 0123456789 from dual select regexp replace 23456中國3 00 45 0 9 from dual 標籤 regexp replace regexp rep...

提取 字串中 數字

include include include void main l if find break 有數字則退出迴圈 else printf 沒有數字 請重新輸入 n gets c 沒有則重新出入 l strlen c l strlen c printf 字串長度為 d n l for i 0 i ...