I have a table of users with when they signed_up and when they were last_seen:
+--------+-----------+-----------+
| userid | signed_up | last_seen |
+--------+-----------+-----------+
| 1 | 1/1/14 | 1/3/14 |
| 2 | 1/1/14 | 1/5/14 |
| 3 | 1/3/14 | 1/5/14 |
| 4 | 1/6/14 | 1/7/14 |
+--------+-----------+-----------+
Lets assume each user comes to the site on everyday between signed_up and last_seen. I'd like to count how many total users there are on each day. The result I'm looking for is below:
+--------+----------------+
| date | count_of_users |
+--------+----------------+
| 1/1/14 | 2 |
| 1/2/14 | 2 |
| 1/3/14 | 3 |
| 1/4/14 | 2 |
| 1/5/14 | 2 |
| 1/6/14 | 1 |
| 1/7/14 | 1 |
+--------+----------------+
And just for clarification, here's how the numbers were calculated (I don't need this table, this is just an illustration)
+--------+----------------+-------+-------+-------+-------+
| date | count_of_users | user1 | user2 | user3 | user4 |
+--------+----------------+-------+-------+-------+-------+
| 1/1/14 | 2 | 1 | 1 | | |
| 1/2/14 | 2 | 1 | 1 | | |
| 1/3/14 | 3 | 1 | 1 | 1 | |
| 1/4/14 | 2 | | 1 | 1 | |
| 1/5/14 | 2 | | 1 | 1 | |
| 1/6/14 | 1 | | | | 1 |
| 1/7/14 | 1 | | | | 1 |
+--------+----------------+-------+-------+-------+-------+
Not sure if this is getting beyond what should be done in MySql... Thanks for the help!