Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 duplicate records

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-09 : 18:17:56
Jason writes "I have about 8 columns in my table. none of the columns are unique. I need to find all of the duplicate records for 7 of the columns. the 8th column doesn't matter, it doesn't have to match. I also have to display all 8 columns AND display both records that are duplicated not just one. Thanx.

example
column
1 2 3 4 5 6 7 8
x y z a b c d e dupe
t q r s t u v w
x y z a b c d t dupe


it needs to be display like this

1 2 3 4 5 6 7 8
x y z a b c d e
x y z a b c d t"

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2002-04-09 : 18:45:35
Sorry, my SQL skills are somewhat rusty and I can't give the solution, however, MS Access has a wizard Find Duplicates which you can use. It will generate the SQL for you. I think it uses self joins, and if your table is large, might take a bit of a while. This is probably not a query you should count on executing very often.

Sarah Berger MCSD
Go to Top of Page

yakoo
Constraint Violating Yak Guru

312 Posts

Posted - 2002-04-09 : 20:47:50
Try this. Although I added an ID field...

EDIT - Removed code (http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=14755) as this thread seems to be a "homework" assignment.



Edited by - yakoo on 04/09/2002 20:50:47
Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-04-10 : 00:20:08
you can read this article Graz wrote on Deleting Duplicate record http://www.sqlteam.com/item.asp?ItemID=3331.



--------------------------------------------------------------


Edited by - Nazim on 04/10/2002 00:30:17
Go to Top of Page
   

- Advertisement -