22,207
社区成员
发帖
与我相关
我的任务
分享
select 颜色,尺寸,avg(数量) as 平均数,sum(销售金额)as 总销售额
from (
select 颜色,尺寸,数量,销售金额单价,销售金额 from CLT_Purchase
where 数量>0 and 销售金额单价<>0
) a
group by 颜色,尺寸--,avg(数量),sum(销售金额)
order by sum(销售金额);
select 颜色,尺寸,avg(数量) as 平均数,sum(销售金额)as 总销售额
from CLT_Purchase
where 数量>0 and 销售金额单价<>0
group by 颜色,尺寸
order by sum(销售金额);