I'm having trouble with my query because I have to deduct the quantity of the product from a different stock_code.
Let say the customer will buy a product in item_code (I0015) for 20 quantities. First I want to deduct the 12 quantities to the stock_code (ST0016) and the stock will become 0, and the remaining 8 quantities will deduct in stock_code (ST0012), the deduction of quantity is based on the ascending date of stock_expired.
How do I query that in MySQL? Thank you so much! The answer is highly appreciated. The name of my table is stocks_table

Aucun commentaire:
Enregistrer un commentaire