sql创建表变量,转百分数

declare @tab table(

ID nt identity(1,1) primary key, --从1开始,每次自增1

,Name nvarchar(200)

)

declare a float

select @NodesPercentage=Cast((cast(round((case when a>1 then 1 else a end),2) as numeric(10,2)))*100 as varchar(20))+'%'

posted @ 2017-07-20 17:05  123BoBoT  阅读(546)  评论(0)    收藏  举报