Write a SQL query to identify recurring customer churn patterns over a specific time window at ServiceTitan.
Use the customer and churn-event data for the reporting window from 2025-01-01 through 2025-06-30. Treat a customer as recurring only when churn occurs in at least two distinct calendar months.
customer_id, customer_name, churn_month_count, first_churn_date, last_churn_date, and churn_months.churn_month_count descending, last_churn_date descending, then customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique ServiceTitan customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique churn event identifier |
| customer_id | INT | Customer associated with the churn event |
| churned_at | DATE | Date on which the customer churned |
| reason | VARCHAR(100) | Recorded reason for churn |