我有一个包含以下数据的sales数据库表:
年 Month Totalsales
2014年-1,1-商品
2014年-2
2014年,2,2,2,0,2,2,2,2,2,2,2,2,2,C,B,B
2014年-3,3
2015年-1/1
2015年-2
我想根据其他列添加销售数据的汇总,如下所示:
年 Month Totalsales
2014年-1,1-商品
2014年-2
2014年,2,2,2,0,2,2,2,2,2,2,2,2,2,C,B,B
2014年-3,3
2015年-1/1
2015年-2
统合性
全社会
所有的商业、商业、金融、商业、金融、金融等行业的所有产品都被认可为2,2
一切可能的.=‘3’>.=
2014年全部转轨转轨
2014年,全部可发性、转轨性、转轨性、无偿性、无偿性、适配性等。
2015年全部转轨转轨
2014年,1,1,1,1,1,1,2,1,2,1,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,1,2,1,1,1,2,1,1,1,1,2,1,1,1,2,1,1,2,1,1,1,2,1,2,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2014年--2-2
2014年-3-3
2015年,1,1,1,1,1,1,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,3,2,3,2,5,5,5,5,5,5,2,5,5,2,4,2,4,2,4,1,1,1,1,1,1,2,1,1,1,2,1,2,1,2,1,1,2,1,2,1,2,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,
2015年-2-2
所有的财政、金融等各方面都是自愿的。
所有的商业、商业、金融、商业、金融等行业的所有产品都被转嫁到了中国,被转嫁到了中国。
2014年,全部转机、转机、转轨等
2015年全部转轨、转轨等
所有的.=‘1’=‘1’个
所有的商业、商业、金融、金融等领域的所有商业、商业、金融等领域的所有商业、商业、金融等领域的
所有的.=‘3’=‘3’3
所有的财政、财政等各方面的全部财政、财政等各方面的全部工作,所有的
有人能把我推向正确的方向吗,在连接到数据库之后,我该怎么做呢?我想用Java来做。我还想以一种高效的方式来实现它,因为真正的表包含了更多的列/记录。
为了澄清:我想编写一个插入聚合数据的智能脚本。我想听听关于这个剧本应该如何运作的一些想法。谢谢!
发布于 2015-03-23 09:59:18
我建议为每个特定的聚合创建views
,然后在这些聚合上发布一个简单的SELECT
。例如:
all 1 dandalion 200
all 2 dandalion 200
all 2 rose 200
all 3 rose 100
可能是
SELECT 'all' as year, month, flowertype, sum(totalsales) from sales group by month, flowertype order by month
下一个街区
2014 all dandalion 200
2014 all rose 200
2015 all dandalion 200
可能是
SELECT year, 'all' as month', flowertype, sum(totalsales) from sales group by year, flowertype order by year
等。
https://stackoverflow.com/questions/29207191
复制相似问题