Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

obtain dublicates from a table 1

Status
Not open for further replies.

MrDontKnowNothing

Programmer
Jun 26, 2003
94
DE
hi again,

a question of interrest and frequent use:

asume you got a table called costumer with columns id, name, email.

you know there are some costumers in the db with the same name and email, but different id:

---id---|---name---|---email---
1 john j@b.com
2 john j@b.com
3 alex a@c.com
4 frank f@v.com
5 tim t@t.com
6 frank f@v.com


how do you get all the dublicates, but only the dublicates?

a result should look like:

---id---|---name---|---email---
1 john j@b.com
2 john j@b.com
4 frank f@v.com
6 frank f@v.com

many thanks for your time!

alex

 


Have a look at BPeisch's suggestion in thread184-751089

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
HI

If you are cheking for name duplication..

SELECT * FROM myTable WHERE name IN ;
(SELECT name FROM myTable ;
HAVING COUNT(*) > 1 GROUP BY name)

:)


____________________________________________
ramani - (Subramanian.G) :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top