Guide 9/9/2026

Identify Churned Users with a Simple SQL Query

#sql query for churned users#identify expired subscriptions sql#find inactive users sql query#sql query subscription status#database query for churn analysis
Quick Answer
SELECT user_id, email, subscription_end_date FROM users WHERE subscription_status = 'expired' AND subscription_end_date < CURRENT_DATE - INTERVAL '30 days';

This query targets your users table to filter out records where the subscription status is marked as expired. By comparing the 'subscription_end_date' against the current date, the query isolates users who have been inactive for more than 30 days.

Using this SQL snippet allows your marketing or retention team to quickly export a list of churned users. You can then use this data to trigger automated re-engagement email campaigns or special discount offers to win back customers who have recently churned.

Ready to try it?

Use our SQL Query Generator to generate perfect results in seconds.

Open SQL Query Generator