Please help,
I have two tables named inventory and delivery, i would like to update the numbers or all balances of items on my inventory in a single click. For now, the only thing i can do is that to search for the item and update the balance, but i have here lots of items to update the balances depending on the delivery table. So here is the process, only 1 unique item will be display on my inventory whereas my delivery table depends on the delivery of that unique item. example, i have 8 quantity of "LAPTOP" on my inventory and here's a new delivery of that item (LAPTOP) which has 5 quantity. and another new delivery on another day with 3 quantity. How can i get the total quantity on my inventory with a single click?
i'd tried the ff code:
sum delivery.balance to sums
SELECT inventory
UPDATE inventory SET balance = SUMs
Items on my Inventory table
LAPTOP = 8
Printer = 5
Items on my Delivery table
LAPTOP = 5
LAPTOP = 3
Output:
LAPTOP = 13
Problem:
It sums up all the balances of my inventory regardless of what item is that.
The output must be:
LAPTOP = 16
Printer = 5
but as you can see it will add all balances with the same quantity. i cannot add the quantity for the same item name.
thanks in advance.
I have two tables named inventory and delivery, i would like to update the numbers or all balances of items on my inventory in a single click. For now, the only thing i can do is that to search for the item and update the balance, but i have here lots of items to update the balances depending on the delivery table. So here is the process, only 1 unique item will be display on my inventory whereas my delivery table depends on the delivery of that unique item. example, i have 8 quantity of "LAPTOP" on my inventory and here's a new delivery of that item (LAPTOP) which has 5 quantity. and another new delivery on another day with 3 quantity. How can i get the total quantity on my inventory with a single click?
i'd tried the ff code:
sum delivery.balance to sums
SELECT inventory
UPDATE inventory SET balance = SUMs
Items on my Inventory table
LAPTOP = 8
Printer = 5
Items on my Delivery table
LAPTOP = 5
LAPTOP = 3
Output:
LAPTOP = 13
Problem:
It sums up all the balances of my inventory regardless of what item is that.
The output must be:
LAPTOP = 16
Printer = 5
but as you can see it will add all balances with the same quantity. i cannot add the quantity for the same item name.
thanks in advance.