My side has a question about computing user retention rates of SQL, want to ask your bosses!
Now retained to users on my side is defined as: in one month to the first single user for new users of the month, the batch new users into a singular next month is greater than or equal to 1, namely for the batches of users, with a retained user next month divided by the total number of initial batch new users, the total is equal to the batch the second month of the new user retention rate, the retention rate of the third month, need into a single greater than or equal to 1 in the second month, on the basis of the third month also into single greater than or equal to 1, be retained, and so on, I can now one by one out a batch of new users, the number of retained in the subsequent one month with user_id in inner join nested, but is very troublesome, a lot of work,
Excuse me is there a good method, can according to the above logic, automatic take out one month the number of retained in new users in the subsequent months? Grateful! To solve the problem out thank!