群里一哥们问,怎么把‘123’+‘1’字符串select成124,
写sql试了下,如下:
SQL> select
2 REGEXP_SUBSTR(b.abc,'[0-9]+') + REGEXP_SUBSTR(b.abc,'+[0-9]') abc
3 from
4 (select replace(a.abc,'''') abc from (select '''123'''||'+'||'''1''' abc from dual) a) b
5 ;
ABC
----------
124
写sql试了下,如下:
SQL> select
2 REGEXP_SUBSTR(b.abc,'[0-9]+') + REGEXP_SUBSTR(b.abc,'+[0-9]') abc
3 from
4 (select replace(a.abc,'''') abc from (select '''123'''||'+'||'''1''' abc from dual) a) b
5 ;
ABC
----------
124
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23249684/viewspace-1387575/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23249684/viewspace-1387575/