SyntaxFix
Write A Post
Hire A Developer
Questions
Since you don't care which id to return I stick with MAX id for each email to simplify SQL query, give it a try
;WITH ue(id) AS ( SELECT MAX(id) FROM table GROUP BY email ) SELECT * FROM table t INNER JOIN ue ON ue.id = t.id