sql语句怎么写?
把每一行的‘用量’除以各自组(这里就两组)的和 然后乘以1000
select 用量* 100 / (select sum(用量) from table t1 where 客户=t.客户) as 百分比 from table t
select sum('用量')*1000 from '表' group by '产品型号';