参考,如果你的后面的空格是固定的,可以直接把%换成‘’:
with AA as(
select '散料SCR1206 ±5% 20R' tt
union all select '散料SCR1206 ±5% 1R5' tt
union all select '散料SCR1206 ±5% 2R' tt
union all select 'SCR1206 ±5% 9R1' tt
union all select '散料SCR1206 ±5% 9R1' tt
union all select '散料SCR1206 ±5% 2K' tt
union all select '散料SCR1206 ±5% 2K6' tt
)
SELECT * FROM (
select REPLACE(SUBSTRING(yyy,CHARINDEX('%',yyy)+1,len(yyy)),'R','') rr
from (
select REPLACE(tt, ' ', '') yyy from AA
where 1=1
and tt like '%R'
) s
) ss