本帖最后由 卖猪仔二号 于 2012-3-13 11:49 编辑
我想能按分类、品名、“1日” as 日期,数量加起来,单价平均求平均值。怎么做到你呢?麻烦你啦。
select 分类,品名,数量,单价,"1日" as 日期 FROM [1日$B3:G103] union all select 分类,品名,数量,单价,"2日" as 日期 FROM [2日$B3:G103] union all select 分类,品名,数量,单价,"3日" as 日期 FROM [3日$B3:G103] union all select 分类,品名,数量,单价,"4日" as 日期 FROM [4日$B3:G103] union all select 分类,品名,数量,单价,"5日" as 日期 FROM [5日$B3:G103] union all select 分类,品名,数量,单价,"6日" as 日期 FROM [6日$B3:G103] union all select 分类,品名,数量,单价,"7日" as 日期 FROM [7日$B3:G103] union all select 分类,品名,数量,单价,"8日" as 日期 FROM [8日$B3:G103] union all select 分类,品名,数量,单价,"9日" as 日期 FROM [9日$B3:G103] union all select 分类,品名,数量,单价,"10日" as 日期 FROM [10日$B3:G103] union all select 分类,品名,数量,单价,"11日" as 日期 FROM [11日$B3:G103] union all select 分类,品名,数量,单价,"12日" as 日期 FROM [12日$B3:G103] union all select 分类,品名,数量,单价,"13日" as 日期 FROM [13日$B3:G103] union all select 分类,品名,数量,单价,"14日" as 日期 FROM [14日$B3:G103] union all select 分类,品名,数量,单价,"15日" as 日期 FROM [15日$B3:G103] union all select 分类,品名,数量,单价,"16日" as 日期 FROM [16日$B3:G103] union all select 分类,品名,数量,单价,"17日" as 日期 FROM [17日$B3:G103] union all select 分类,品名,数量,单价,"18日" as 日期 FROM [18日$B3:G103] union all select 分类,品名,数量,单价,"19日" as 日期 FROM [19日$B3:G103] union all select 分类,品名,数量,单价,"20日" as 日期 FROM [20日$B3:G103] union all select 分类,品名,数量,单价,"21日" as 日期 FROM [21日$B3:G103] union all select 分类,品名,数量,单价,"22日" as 日期 FROM [22日$B3:G103] union all select 分类,品名,数量,单价,"23日" as 日期 FROM [23日$B3:G103] union all select 分类,品名,数量,单价,"24日" as 日期 FROM [24日$B3:G103] union all select 分类,品名,数量,单价,"25日" as 日期 FROM [25日$B3:G103] union all select 分类,品名,数量,单价,"26日" as 日期 FROM [26日$B3:G103] union all select 分类,品名,数量,单价,"27日" as 日期 FROM [27日$B3:G103] union all select 分类,品名,数量,单价,"28日" as 日期 FROM [28日$B3:G103] union all select 分类,品名,数量,单价,"29日" as 日期 FROM [29日$B3:G103] union all select 分类,品名,数量,单价,"30日" as 日期 FROM [30日$B3:G103] union all select 分类,品名,数量,单价,"31日" as 日期 FROM [31日$B3:G103]
这是我之前写的 |