Remove duplicates based om value of one field

Hi,

When I do the following I will get a list of Names and their Emailaddress.
SELECT DISTINCT Name, Email

Now I want to make sure that the same E-mailaddress is never more than once in the selection.
Is there a way to filter these out somehow?
Stef MerlijnDeveloperAsked:
Who is Participating?
 
slightwv (䄆 Netminder)Connect With a Mentor Commented:
To just grab the first email if they repeat try this:

select name, email from
(
select name, email, row_number() over(partition by email order by email) as myrn
from table
)
where myrn=1;
0
 
slightwv (䄆 Netminder) Commented:
Not sure I understand.  What it the email is the same but name is different.

What do you want returned?

Sample data and expected results would help.
0
 
Stef MerlijnDeveloperAuthor Commented:
This is what I intended. Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.