SELECT email,SUM(CASE WHEN renewal_status = 'Success' THEN 1 ELSE 0 END) as success_count,SUM(CASE WHEN renewal_status = 'Failure' THEN 1 ELSE 0 END) as failure_count
FROM subscribers
GROUP BY email;
SELECT email,SUM(CASE WHEN renewal_status = 'Success' THEN 1 ELSE 0 END) as success_count,SUM(CASE WHEN renewal_status = 'Failure' THEN 1 ELSE 0 END) as failure_count
FROM subscribers
GROUP BY email;