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

show ALL duplicate entries

Status
Not open for further replies.

robschm

Programmer
Mar 26, 2002
10
0
0
DE
i want to see all duplicate entries of a table.

i tried:

SELECT * FROM name GROUP BY first HAVING COUNT(*) > 1 ORDER BY first


but this shows only the group of all duplicate, but i want to see all duplicate row for row. the problem is, to make a count(*)>1 without a group by. is it possible (i dont think so).

HELP
 
Make a self-join:

select a.*
from name a,
name b
where a.first = b.first
and a.anothercolumn > b.anothercolumn;

if you want one of the duplicates

select distinct a.*
from name a,
name b
where a.first = b.first;

if you want all duplicate rows
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top