Skip to main content
June 22, 2006
Answered

Remove duplicate records

Hello,

A query contains serveral names.
Is it possible to output the names, leaving out the duplicates?

So if you have five records: dany dany dany john mary
Output: dany john mary

Tnx for any help!
This topic is closed to new replies. Start a new post to keep the conversation going.
rizalfirCorrect answer
Participating Frequently
June 22, 2006
Can you just use "distinct" ?

select distinct names from mytable

3 replies

Inspiring
June 22, 2006
You can also use the GROUP BY syntax to get a count of duplicate items
select names, count(*) as hits
from mytable
group by names
order by names ASC
Translate
June 22, 2006
This works perfectly. Dind't know the distinct argument. Tnx!
Translate
rizalfirCorrect answer
Participating Frequently
June 22, 2006
Can you just use "distinct" ?

select distinct names from mytable
Translate