I have 3 tables

table 1 and table 2 are both associated to table 3 with "ItemId" foreign key

I want to write a query which will return some statistical data based on these tables

table 3 provides the name column, the rest is from the other two

```
SELECT t1.ItemId, name, currentQuantity, previousQuantity, currentValue, previousValue
FROM (
  SELECT ItemId, SUM(quantity) as currentQuantity, SUM(quantity * purchaseNetPrice) AS currentValue
  FROM table_1
  GROUP BY ItemId
) AS t1
LEFT JOIN (
  SELECT ItemId, SUM(quantity) as previousQuantity, SUM(quantity * purchaseNetPrice) AS previousValue
  FROM table_2
  GROUP BY ItemId
) AS t2 ON t1.ItemId = t2.ItemId
INNER JOIN table_3 ON table_1.ItemId = table_3.ItemId

```

This will output

```
ItemId | name |  currentQuantity  | previousQuantity| currentValue | previousValue
-------+------+-------------------+-----------------+--------------+---------------
 1     |ITEM1 | 4500              | 27000           | 523000       | 3240000       |
 2     |ITEM2 | 5800              | 15000           | 386000       | 2250000       |

```

Which is fine at this point, but I also want to calculate the quantity and value difference so

```
ItemId | name |  currentQuantity  | previousQuantity| currentValue | previousValue | qDiff | valDiff
-------+------+-------------------+-----------------+--------------+---------------
 1     |ITEM1 | 4500              | 27000           | 523000       | 3240000       | diff  | diff
 2     |ITEM2 | 5800              | 15000           | 386000       | 2250000       | diff  | diff

```

with the following logic: 

quantity difference -> currentQuantity - previousQuantity

value difference -> currentValue - previousValue

Where do I put this in a single query?