Hi all, I have two tables with similar fields, first table is stock of products and the second table is count of sold products, like this :

And now I want to create this query : (Subtract each sum product with together, for example to A : (50 +30)- (5+8) = 67)

Table 1 |

Field 1 | Field 2 |

A1 | 50 |

A1 | 30 |

A2 | 40 |

A3 | 20 |

A3 | 60 |

A2 | 70 |

Table 2 |

Field 1 | Field 2 |

A1 | 5 |

A2 | 4 |

A2 | 2 |

A1 | 8 |

A3 | 7 |

And now I want to create this query : (Subtract each sum product with together, for example to A : (50 +30)- (5+8) = 67)

Query |

Field 1 | Field 2 |

A1 | 67 |

A2 | 104 |

A3 | 73 |

Last edited: