A person uses his cell phone several times a day, and the duration of their calls varies. I track the length of calls in a table:
Calls [callID, memberID, startTime, duration]
I need a request to return the average length of a request for users per day . A day means that if the user used the phone 3 times, the first time within 5 minutes, the second within 10 minutes and the last time within 7 minutes, the calculation:5 + 10 + 7 / 3 = ...
Note:
People don’t use the phone every day, so we should get the average daily day per person and use it to get the total average call duration.
we don’t want to recount anyone on average, so only 1 line per user will calculate the average duration of a daily call.
Some clarifications ...
I need a total average value per day, based on the average for each user per day, using the numbers of the last days for users (since we only count the specified ONCE user in the request), so this will mean that we will be using different days of Wednesdays. as people may not use the phone every day or even on the same day.
Anonymous cow
source
share