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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to show duplicate records...? 1

Status
Not open for further replies.

xhonzi

Programmer
Jul 29, 2003
196
US
I have a table full of stuff. One field, issueid, is the unique key from another table but is not unique in this one. In fact, this is what I want to check. I want a query to show me records that have duplicates (for that field). If I have two records with issueid of 1, and only one with issueid of 2... I want a query that will show me just the 1's. I can't really test on specific issueid's though, since there are several thousand of them.

Is there an easy way to do this?

Xhonzi
 
Something like this ?
SELECT A.* FROM yourTable As A INNER JOIN
(SELECT issueid FROM yourTable GROUP BY issueid HAVING Count(*)>1) As B
ON A.issueid = B.issueid;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Wow.

I'm not quite sure how that works... but it works like a charm. Thank you very much.

Xhonzi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top