-1

I got the table looks like this, and user devices will send data back to the database, and I want to make a sql tool to check user update rate:

table:

username    id     current_state    speed    and.......
 me         01         online       5 m/s    xxxxx

for example, when user's devices are online, the current_state will turn to online, and how to use the query to make a summary about how many user's information changed in a given day.

Thanks

Laxmi
  • 3,830
  • 26
  • 30
  • Maybe you can use something like this. https://stackoverflow.com/questions/12563706/is-there-a-mysql-option-feature-to-track-history-of-changes-to-records – Willas Jan 16 '18 at 06:53

1 Answers1

0

You have 2 options (maybe even more) but what I think is :

  1. Option 1 : trigger (People don´t usually want this one). You can just have another table and use a trigger to insert in that table when you have an update in online.
  2. Option 2 : audit table (I never use this option before).

If the business requirement is "show me what the state of the data was on a given date in the past", it means that the aspect of change over time has entered your solution.

Is there a MySQL option/feature to track history of changes to records?

You must check this question.

Willas
  • 63
  • 1
  • 10