I am trying to display active users in webapp. My database consists of two main tables: user and task . task has a user_id .
My definition of active users : is the user who created more than two tasks within two weeks from the specified end date.
So, I need an SQL query that gives me the number of active users between the start and end dates. I was able to do this by putting the query inside the loop, pulling the results each time, but I would like to do it in one query.
The returned data should look something like this:
Date Count 2010-01-01 4 2010-01-02 3 2010-01-03 5
Modify to clarify the required data set.
source share