|
- (无聊做的简化,其中SQL3,要手工删除多余两列的明细字段)
- SQL1
- :SELECT A.客户编码,B.数量,B.开单价,B.金额 FROM (select 客户编码,SUM(金额) FROM [SHEET1$] GROUP BY 客户编码 HAVING SUM(金额)>100000) A,(SELECT 客户编码,数量,金额,开单价 FROM [SHEET1$]) B WHERE A.客户编码=B.客户编码
- SQL2:
- SELECT A.客户编码,B.数量,B.开单价,B.金额 FROM (select 客户编码,SUM(金额) FROM [SHEET1$] GROUP BY 客户编码 HAVING SUM(金额)>100000) A,(SELECT * FROM [SHEET1$]) B WHERE A.客户编码=B.客户编码
- SQL3:
- SELECT * FROM (select 客户编码,SUM(金额) FROM [SHEET1$] GROUP BY 客户编码 HAVING SUM(金额)>100000) A,(SELECT * FROM [SHEET1$]) B WHERE A.客户编码=B.客户编码
复制代码 看动画演示,明细在表3.
[ 本帖最后由 wuxiang_123 于 2009-12-20 15:51 编辑 ] |
|