We have a data extension to which the data is being imported from another system. Sometimes, an Id that's used as SubscriberKey for sending emails appears twice (we are using another primaryKey in SFMC DE which is generated uniquely by that system for each row so there's no PK violation). Now, we wanted to use a GROUP BY function, but although the syntax is correct, the results are not grouped by this ID and therefore, we're still getting duplicates. I tried removing the primaryKey, but it did not help. Here's the code:
SELECT
COUNT(Consent_Name) AS Instances,
ID,
Product,
Customer_Name,
Email
FROM table_1
GROUP BY
ID,Product,Customer_Name,Email