Sum of sale of each partnumber .and partnumber have its substitute partnumber in another table : I have two table first have part number and sale of each month.
And another table have substitute part of part number.
Table 1
Partnumber     jun19sale   jul19sale
A                         1                1
B                         2                1
C                         3                4
E                         5                3
D                         1                2

Table2

Partnumber     subpart   
A                         B               
A                         C               
A                         D               
How can i get somthing like this.
Partnumber     jun19sale   jul19sale
A                         7               8
B                         7               8
C                         7               8
E                         5               3
D                         7               8
I try with subqueries with or,in which give me accurate result .but its take to much time. Because table have large amount of data. Please suggest best way.             Thanks in advanced