Answer the question
In order to leave comments, you need to log in
What is the best way to organize a MySQL database?
Good day to all. I am writing a small application, in this application, a person will enter certain data on an ongoing basis (maybe every day, maybe twice a week, maybe once a month), let's say "the total amount of something". How do I best stuff this "total amount of something" into the database? I have several tables - users , history , statistics . The information added by the user gets into the history table and from it, through simple mathematical operations and functions, statistics based on the history will get statistics in order to display this information to the user later. The question is how can I track information from statistics, on a daily basis, thereby providing the user with information about what day, what year, what indicators he had from statistics. A kind of application with little analytics.
Thanks
Answer the question
In order to leave comments, you need to log in
Add a field of type timestamp to statistics, and then select on this field of type select * from statistics where `this field` betweeen from_unixtime(`from date-time`) and from_unixtime(`by date-time`). Not?
You can hang a trigger on statistics before insert and write in the timestamp field
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question