sql语句怎么写?
把每一行的‘用量’除以各自组(这里就两组)的和 然后乘以1000
收起
select 用量* 100 / (select sum(用量) from table t1 where 客户=t.客户) as 百分比 from table t
报告相同问题?