Sorry in advance if the question is repeated, but i have a goal that i want to know how many emails the subscribers from a specific DE received in last and each month.
I tried to use the sintax below, but the numbers of records that the SQL is get it is very different to the number of total sent;
The primary key in target De is Month and SubscriberKey to get the number each month send for subscribers
SELECT x.* FROM ( SELECT count(*) AS TotalSent, DATENAME(month, p.EventDate) as [MONTH], row_number()over(partition by p.SubscriberKey ORDER BY P.EventDate DESC) AS row, 'XX' as [Business_Unit], p.SubscriberKey as SubscriberKey FROM _Sent p INNER JOIN [Clients_XX] B ON p.SubscriberKey = B.AccountID WHERE p.EventDate BETWEEN DATEADD(day, -365, CURRENT_TIMESTAMP) AND CURRENT_TIMESTAMP CURRENT_TIMESTAMP GROUP BY p.EventDate, p.SubscriberKey HAVING COUNT(*) > 0 ) x WHERE x.row = 1