日期:2014-05-17 浏览次数:20535 次
declare @str varchar(100)
declare @i int
set @str = 'dfji2349234.sfk23rd'
set @i = patindex('%[^1-9,^.]%',@str)
while @i>0
begin
set @str = stuff(@str,patindex('%[^1-9,^.]%',@str),1,'')
set @i = patindex('%[^1-9,^.]%',@str)
end
select @str
/************
----------------------------------------------------------------
2349234.23
(1 行受影响)