Created
November 20, 2020 09:37
-
-
Save zuzannamj/7521b300bd2cce8b067667b28e868ce9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT contact.Email, | |
contact.Id | |
FROM ent.Contact_Salesforce contact | |
INNER JOIN ( | |
SELECT Email, | |
MAX(Id) AS Id | |
FROM ent.Contact_Salesforce | |
GROUP BY Email | |
) aggr | |
ON aggr.Email = contact.Email AND aggr.Id = contact.Id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment