博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在sql中获取字符串中的数字的函数
阅读量:4211 次
发布时间:2019-05-26

本文共 251 字,大约阅读时间需要 1 分钟。

根据PATINDEX系统函数的引用正则表达式

/*    
    
功能:获取字符串中的数字
 
*/
create
function
dbo.F_Get_Number (@S
varchar
(100))
returns
int
AS
begin
    
while PATINDEX(
'%[^0-9]%'
,@S)>0
          
begin
                
set
@s=stuff(@s,patindex(
'%[^0-9]%'
,@s),1,
''
)
          
end
    
return
cast
(@S
as
int
)
end
--测试
---selec

转载地址:http://aozmi.baihongyu.com/

你可能感兴趣的文章
RAC 安装patch 后启动实例 报错 ORA-00439 feature not enabled- Real Application Clusters 解决方法
查看>>
On RAC, expdp Removes the Service Name [ID 1269319.1]
查看>>
Important Changes to Oracle Database Patch Sets Starting With 11.2.0.2 [ID 1189783.1]
查看>>
Oracle RAC 平台下 Patch 安装与卸载 步骤
查看>>
Oracle Database 11gR1 和 10gR2 ASM Best Practices 说明文档
查看>>
ASM Concepts Quick Overview [ID 1086199.1]
查看>>
PowerDesigner 业务处理模型( BPM ) 说明
查看>>
PowerDesigner 企业架构模型 ( EAM ) 说明
查看>>
PowerDesigner 正向工程 和 逆向工程 说明
查看>>
PowerDesigner 模型文档 说明
查看>>
PowerDesigner 系列 小结
查看>>
Oracle 升级10.2.0.5.4 OPatch 报错Patch 12419392 Optional component(s) missing 解决方法
查看>>
Oracle sessions,processes 和 transactions 参数 关系 说明
查看>>
RMAN 备份报错 RMAN-06207 RMAN-06208 解决方法
查看>>
[INS-35172] Target database memory (XXMB) exceeds the systems available shared memory ({0}MB) 解决方法
查看>>
深入理解 OUI(Oracle Universal Installer)
查看>>
Oracle LOB 详解
查看>>
磁盘性能 -- IOPS 和 吞吐量 说明
查看>>
Oracle Heap size XXK exceeds notification threshold (2048K) 解决方法
查看>>
Oracle Gloden Gate 系列三 -- GG 支持与不支持的对象类型与操作 说明
查看>>