|
能解释下SQL语句里面的A6-A2都是指的什么吗?就这个看不懂具体指代的是什么内容
select A6.*,A5.货代费用,A4.分摊业务费 from(select 业务员,发票号,sum(合同数量) as 合同数,sum(材料金额) as 材料金,sum(出货数量) as 出货数,sum(销售总价) as 销售总 from [出货明细$] group by 业务员,发票号) A6, (select 发票号,sum(汇总) as 货代费用 from [货代明细$] group by 发票号) A5,(select A1.发票号, A3.业务费用*(A1.销售总/A2.销售总计) as 分摊业务费 from (select 发票号,sum(销售总价) as 销售总 from [出货明细$] group by 发票号) A1, (select sum(销售总价) as 销售总计 from [出货明细$] ) A2,(select sum(金额) as 业务费用 from [费用明细$] where 金额 >0) A3) A4 where A6.发票号=A5.发票号 and A6.发票号=A4.发票号 |
|