日期:2014-05-16 浏览次数:20631 次
select
parsename(replace(a,'/','.'),2) as b,
replace(parsename(replace(a,'/','.'),1),'m','') as c
from
tb
create table sh
(字段A varchar(100))
insert into sh
select '100*200*10*20/12m' union all
select '110*210*10*30/6m' union all
select '500*300*15*16/300m' union all
select '7000*8000*20*25/2000m'
select substring(字段A,1,patindex('%/%m',字段A)-1) 'B',
replace(substring(字段A,patindex('%/%m',字段A)+1,100),'m','') 'C'
from sh
/*
B C
------------------------------ ----------------
100*200*10*20 12
110*210*10*30 6
500*300*15*16 300
7000*8000*20*25 2000
(4 row(s) affected)
*/