There is a login log table with id, user id, login time, and query the average number of login users per day for the last 30 days.

idid30
Sql
Aug.06,2021

look at your question. Isn't it good to use bwtween to check the total number of records in 30 days by dividing the number of days? it's not very clear what you want to ask.


what is the average number of login users here? isn't it the total number of logins per day? what are your average conditions


if you need to count on a daily basis? When designing a table, you should add a field to store the day on which the log was added.


the login time should be recorded in the user's log table after the user logs in (can also be called the last login time).
the login time can be recorded in the exitTime or other fields recorded when logging out, and subtracted from the login time, recorded in the log.
other things such as which pages the user visits, data updates, encryption, adding friends, etc. Log can be recorded when the activity is triggered.

Menu