-- Wholesale accounts created, by segment -- CRM accounts not deleted by the month created. SELECT strftime(CreatedDate, '%Y-%m') AS month, Segment__c AS grp, count(*) AS value FROM crm.account WHERE CreatedDate >= TIMESTAMP '2023-10-01' AND CreatedDate < TIMESTAMP '2026-10-01' AND (NOT IsDeleted) GROUP BY 1, 2 ORDER BY 1, 2