CREATE FUNCTION [dbo].[GET_NUMBER] (@S VARCHAR(100)) RETURNS VARCHAR(100)ASBEGIN WHILE PATINDEX('%[^0-9\.\^0-9]%', @S) > 0 BEGIN SET @S = STUFF(@S, PATINDEX('%[^0-9\.\^0-9]%', @S), 1, ''); END; RETURN @S;END
PATINDEX用法详细推荐
https://www.cnblogs.com/accumulater/p/7250983.html