I'm trying to create a query, that will calculate sum of products on invoice. I have 3 tables :
- Product (with product's price)
- Invoice (with invoice id)
- Products on invoice (with invoice id, product id and number of particular products)
So in my query I take invoice_id (from invoice), price (from product),number of products sold and invoice_id (from products on invoice) and calculate their product in fourth column. I know I should use 'Totals' but how to achieve that ?
products_on_invoice
table in addition to theproduct
table so that you can change the product's price without affecting pastproducts_on_invoice
entries. – Nitrodist