下面是我用excel链接acess里面的数据所写的代码,因为数据有300M,数据量大,每次对透视表更新数据的时候需要20多分钟,太慢,各位高手有没有什么方法可以优化代码,以达到高效获取数据的效果。
select 经销商名称,款号,综合类别,商品颜色,性别,商务大类,商务小类,日期,年份,实际发货数量,0 as 实际销售数量,0 as 实际零售数量,实际发货金额,0 as 实际销售金额,0 as 实际零售金额,预计发货成本额,0 as 预计销售成本额,0 as 零售成本额,预计发货毛利,0 as 预计销售毛利,0 as 预计零售毛利,供应商名称,采购单价,材质,0 as 订单数量 from [发货查询] union all
select 经销商名称,款号,综合类别,商品颜色,性别,商务大类,商务小类,日期,年份,0 as 实际发货数量,实际销售数量,0 as 实际零售数量,0 as 实际发货金额,实际销售金额,0 as 实际零售金额,0 as 预计发货成本额,预计销售成本额,0 as 预计零售成本额,0 as 预计发货毛利,预计销售毛利,0 as 预计零售毛利,供应商名称,采购单价,材质,0 as 订单数量 from [销售查询] union all
select 经销商名称,款号,综合类别,商品颜色,性别,商务大类,商务小类,日期,年份,0 as 实际发货数量,0 as 实际销售数量,实际零售数量,0 as 实际发货金额,0 as 实际销售金额,实际零售金额,0 as 预计发货成本额,0 as 预计销售成本额,预计零售成本额,0 as 预计发货毛利,0 as 预计销售毛利,预计零售毛利,供应商名称,采购单价,材质,0 as 订单数量 from [零售查询] UNION ALL select 经销商名称,款号,综合类别,商品颜色,性别,商务大类,商务小类,日期,年份,0 as 实际发货数量,0 as 实际销售数量,0 as 实际零售数量,0 as 实际发货金额,0 as 实际销售金额,0 as 实际零售金额,0 as 预计发货成本额,0 as 预计销售成本额,0 as 预计零售成本额,0 as 预计发货毛利,0 as 预计销售毛利,0 as 预计零售毛利,供应商名称,采购单价,材质,订单数量 from [订单查询]; |