select a,b,c,d,sumC=sum(cast(c as int)) from 表 where b='xxx'

解决方案 »

  1.   

    select a,b,c,d,sum(cast(c as float)) as total from 表 where b='?' group by a,b,c,d
      

  2.   

    select a+b+c+d from b=b
      

  3.   

    如果只顯示一條記錄,用下面:
    select max(a),max(b),max(c),max(d),sum(cast(c as float)) as total from 表 where b='?' 或者select max(cast(a as varchar(20))+','+cast(b as varchar(20))+cast(c as varchar(20))+cast(d as varchar(20))),sum(cast(c as float)) as total from 表 where b='?' 
      

  4.   

    select a,b,c,d,sum(cast(c as float)) from 表 where b=条件