Hello!
I've the following structure:
Tables:
The "available credit" table has the limit that each person can order from each item.
I want to make a view that shows how much each person has consumed and how much credit is available for each item.
But I was only able to show the total orders and credit without separating by product.
How is your available_credit table structured? I'd imagine a ref column to People, a ref column to Products, and a Number or Decimal column indicating their limit, with a record for every possible person-product combination? If so, you can add in virtual columns to this table to sum up the number of products ordered per person, then create a view on this table, grouped by product.
You might find something helpful from this part from a series of videos covering how to make and evolve a shopping cart app.
Kinda sounds like I need to pick this series back up again and include a credit aspect. (^_^)
User | Count |
---|---|
41 | |
25 | |
25 | |
17 | |
12 |