从 MySQL 表中提取数据,数据如下所示:
Acct # Acct Name Item Date Sold Qty Sold
10293 Company A Canon JX200 2012-06-24 1
11042 Company B Canon JX200 2012-06-05 2
12560 Company D Canon L90 2012-04-20 1
12560 Company D Canon L90 2012-05-07 1
14160 Company D Canon L90 2012-05-22 2
14168 Company C Canon L90 2012-04-20 6
我想要如下所示的输出:
Acct # Acct Name Item Mo 1 Mo 2 Mo 3 Mo 4 Mo 5 Mo 6 Tot
10293 Company A Canon JX200 1 1
11042 Company B Canon JX200 2 2
12560 Company C Canon L90 6 6
12560 Company D Canon L90 1 3 4
大学里的 Aced 2 线性代数课程和 php 数组让我难过。需要将我的数据放入数组,排序和汇总。最大的问题(我认为)是构建数组的代码。提前致谢!