SQL语句截取字符解决方法

SQL语句截取字符如例:IDAddress10.1四川20.2四川xxxxx30.3四川yyyyyyyy40.4四川xxxxxxxxxx我需要的结果如

SQL语句截取字符
如例:

ID              Address                              

1               0.1四川
2               0.2四川xxxxx
3               0.3四川yyyyyyyy
4               0.4四川xxxxxxxxxx

我需要的结果如下

ID              Address                              

1               四川
2               四川xxxxx
3               四川yyyyyyyy
4               四川xxxxxxxxxx

求SQL一条

[解决办法]


select 1 ID, N'0.1四川' Address
into #t
union all select 2, N'0.2四川xxxxx'
union all select 3, N'0.3四川yyyyyyyy'
union all select 4, N'0.4四川xxxxxxxxxx'

select id,SUBSTRING(Address, PATINDEX('%[^0-9.]%',Address),LEN(Address)- PATINDEX('%[^0-9.]%',Address)+1) Address
from #t;