我有这样的文字“running hl loan hdfc 9.5% customer is not interested”我想从整个字符串中只选择9.5%。无论是什么字符串,但我想只选择%值。
running hl loan hdfc 9.5% customer is not interested
9.5%
在SQL-Server中,您可以使用SUBSTRING,PATINDEX和CHARINDEX:
declare @str as varchar(155) set @str = 'running hl loan hdfc 8569.5% customer is not interested' select SUBSTRING(@str, PATINDEX('%[0-9]%', @str), CHARINDEX('%', @str) - PATINDEX('%[0-9]%', @str) + 1)