name query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query with 50 peoples names in, some names appear more than once.
What I want to do it to show all names that appear more than once and not
show any name that appears once.

thanks
 
SELECT DISTINCT PeopleNames FROM [The Table] as T
WHERE (select count(*) from [THE TABLE] as T1
where T1.PeopleNames = T.PeopleNames) > 1
ORDER BY PeopleNames;

You need the DISTINCT to get the name only once. Otherwise, all of the rows
for each of the names that appear more than once in the table will be
presented.

Good Luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top