Postgresql – Count users that switch from plan A to plan B every month
I want to count all users that switch from ADVANCED plan to BASIC every month. So, the table plans contain the following data: id userId plan_name start_date 1 20 ADVANCED 2023-06-30 15:07:10.211 2 20 ADVANCED 2023-06-05 12:05:14.289 3 40 BASIC…