If I have rows containing user information, including two timestamp values contains 'created' and 'deleted' data (where 'deleted' is null if the account is active), is there a way to count active users on a given day (i.e. between those two values)?
Example:
| id | created | deleted |
|---|---|---|
| 01 | 2022-05-01 | 2022-08-01 |
| 02 | 2022-06-01 | 2022-08-13 |
| 03 | 2022-07-01 | NULL |
What I would like returned:
| date | active_user_count |
|---|---|
| 2022-05-01 | 1 |
| 2022-06-01 | 2 |
| 2022-07-01 | 3 |
| 2022-08-01 | 2 |
| 2022-08-25 | 1 |