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!

Getting duplicate entries 1

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
What would the query be for getting a duplicate entry.

ID DOCID DRFNAME DRLNAME
1 JSMITH Joe Smith
2 JSMITH Joe Smith
3 TJONES Thomas Jones


I just want the JSMITH's

Thanks in advance

AJ
[americanflag]

Do you feel lucky?


 
select docid, count(*)
from mytable
having count(*) > 1


or if you want the detail rows, too:


select * from mytable
where docid in
(select docid
from mytable
having count(*) > 1
)


Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top