日期:2014-05-17 浏览次数:20412 次
declare @i varchar(20)
set @i='60.5*31.6*34.8'
exec ('select '+@i)
declare @s varchar(32)='60.5*31.6*34.8'
declare @chang varchar(32)
declare @kuan varchar(32)
declare @gao varchar(32)
select @chang=SUBSTRING(@s,1, CHARINDEX('*',@s)-1)
select @kuan=SUBSTRING(@s,CHARINDEX('*',@s)+1,len(@s)-CHARINDEX('*',@s))
select @gao=SUBSTRING(@kuan,CHARINDEX('*',@kuan)+1,LEN(@s)-len(@kuan))
select @kuan=SUBSTRING(@kuan,1,CHARINDEX('*',@kuan)-1)
select @chang,@kuan,@gao