如图,我需要计算从使命感刀组织原则的所有列的和,字段是nvchar类型,怎么做?
select sum( ) where name='白浩' and 评价人='lichunlong'
sum怎么写
字段类型为nvchar,还要转为float
select sum( CONVERT(FLOAT,使命感)+CONVERT(FLOAT,团队意识)+CONVERT(FLOAT,工作能力)+CONVERT(FLOAT,学习力)+CONVERT(FLOAT,组织原则) ) from votetempleader where name='白浩' and 评价人='lichunlong'
select sum( cast(使命感 as float)+cast(团队意识 as float)+cast(工作能力 as float)+cast(学习力 as float)+cast(组织原则 as float)) where name='白浩' and 评价人='lichunlong'