日期:2014-05-18 浏览次数:20405 次
declare @box2persent float declare @box3persent float declare @box4persent float declare @box2realsentcount int declare @box3realsentcount int declare @box4realsentcount int declare @totalpersent int set @box2persent=40 set @box3persent=50 set @box4persent=90 set @totalpersent=0 select @box2realsentcount=realsendcount from @result where servertype=130 select @box3realsentcount=realsendcount from @result where servertype=131 select @box4realsentcount=realsendcount from @result where servertype=216 set @box2realsentcount=@box2realsentcount*@box2persent/100 set @box3realsentcount=@box3realsentcount*@box3persent/100 set @box4realsentcount=@box4realsentcount*@box4persent/100 set @totalpersent=@box2realsentcount+@box3realsentcount+@box4realsentcount print @totalpersent print @box2realsentcount print @box3realsentcount print isnull(@box4realsentcount,0) 结果: (2 row(s) affected) (1 row(s) affected) (2 row(s) affected) 3648 3696 0