I would like to make a query that calculates quantity at hand of a product. I have a product table and other table that records the amount of product removed with it's orderID. The problem I have is if no product has been removed, that is if there is no orders I can't get those records in the query. I only get in the query only the records where there is associated orders.
In the end quantity at hand is the quantity stored minus what has been withdrawn + amount that is returned.
If nothing has been withdrawn then quantity at hand is therefore just the quantity stored.
I would like this inventory query to show me quantity at hand for all products.
I'll appreciate help!