Php 将两个不同表中的多行相加

Php 将两个不同表中的多行相加,php,Php,我有两个字段完全相似的表。第一个表是originalentry,第二个表是deprcharge。originalentry的字段如下所示: aid | desc | assetype | date | DoP | Misc | amt 在originalentry表中,我有以下内容: 1 | Land @ borough | L & B | 2013/5/23 | 2013/2014 | xyz | 4000 2 | Fan | Electronics | 2013/8/20 |

我有两个字段完全相似的表。第一个表是
originalentry
,第二个表是
deprcharge
originalentry
的字段如下所示:

aid | desc | assetype | date | DoP | Misc | amt
originalentry
表中,我有以下内容:

1  | Land @ borough | L & B | 2013/5/23 | 2013/2014 | xyz | 4000
2  | Fan | Electronics | 2013/8/20 | 2013/2014 | xyz | 3000
3  | Land @ orit | L & B | 2013/10/23 | 2013/2014 | xyz | 6000
4  | Land @ bradley | L & B | 2014/2/23 | 2014/2015 | xyz | 5000
1  | depreciation chrg | L & B | 2013/12/23 | 2013/2014 | xyz | 1000
2  | depreciation chrg | Electronics | 2013/12/23 | 2013/2014 | xyz | 200
3  | depreciation chrg | L & B | 2014/12/23 | 2014/2015 | xyz | 2000
4  | depreciation chrg | Electronics | 2014/12/23 | 2014/2015 | xyz | 200
对于
deprcharge
表,我有以下内容:

1  | Land @ borough | L & B | 2013/5/23 | 2013/2014 | xyz | 4000
2  | Fan | Electronics | 2013/8/20 | 2013/2014 | xyz | 3000
3  | Land @ orit | L & B | 2013/10/23 | 2013/2014 | xyz | 6000
4  | Land @ bradley | L & B | 2014/2/23 | 2014/2015 | xyz | 5000
1  | depreciation chrg | L & B | 2013/12/23 | 2013/2014 | xyz | 1000
2  | depreciation chrg | Electronics | 2013/12/23 | 2013/2014 | xyz | 200
3  | depreciation chrg | L & B | 2014/12/23 | 2014/2015 | xyz | 2000
4  | depreciation chrg | Electronics | 2014/12/23 | 2014/2015 | xyz | 200
我真正想要的是用php将这些记录显示出来,这样它将按照
assetype
DoP@
进行分组,比如2014/2015年(当前年份),例如:


尽管我有第三个名为
asssetype
的表,其中存储了所有资产类型以供参考。

请使用工具设置此问题的格式。这很难读。你能具体说明问题吗?我不能理解主题,数据库?这与PHP有什么关系?我在mysql数据库中有这三个表,我想总结其中的数字,以得到我真正想要的