数据库集合函数混合使用

 

http://topic.csdn.net/u/20071211/11/cd5aef10-1dfe-498a-928d-0451bb59238b.html
sum(d.shoujia)/ cast(sum(d.danjia) as float) 将除数或被除数类型转成浮点型就行了
cast(sum(d.shoujia)/cast(sum(d.danjia) as float) * 100 as varchar(10)) + '%'

你可能感兴趣的:(数据库)