declare @a table(出口规格 varchar(200),出口重量 decimal(10,3)) insert @a select '0.27*1003*C',143.995 union all select '0.3*1003*C',695.085 union all select '0.3*1040*C',18.18
select 出口=substring(出口规格,charindex('*',出口规格)+1,len(出口规格)-charindex('*',出口规格)-2),出口重量 from @a
后面可真不会写了。临时写了一个(用RIGHT来取)是 select substring(出口规格,charindex('*',出口规格)+1,convert(float,right(出口规格,2))) as 出口厚度 from 表 可是转制类型错误,谢谢各位,问题已经解决了,今天又有收获,呵呵,菜菜的我前两天也回答了一个新人的问题,这里的氛围真的好好,再次感谢大家。 另,希望大家对我上面的语句作出改正,它提示转换类型失败。。。