Answer the question
In order to leave comments, you need to log in
How to make a field that will automatically change depending on the data in another table?
There is a table:
With general information about several users
stat:
id | total_amount | total_items
And there is a table with his
inventory items:
id|items_total| amount | stat_id
Is it possible to make the fields stat.total_amount and stat.total_items automatically calculated
So that when a new inventory is added,
total_amount would be updated with the query: select sum(id) from inventory
total items: select count(id) from inventory
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question