我有这个varchar字段;
Substrg
--------
38-40week
8month
7
40
38-40week
我只想获得数字,例如:
38-40
8
7
40
38-40
我试过这个,但不起作用…:
select SUBSTRING(Substrg, PATINDEX('%[0-9]%', Substrg), LEN(Substrg))
我该怎么办?感谢
select replace ('38-40week', SUBSTRING('38-40week', PATINDEX('%[a-z]%', '38-40week'),
LEN('38-40week')),'')