Home > Archive > SQL server exams > November 2001 > Query for duplicate records





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Query for duplicate records
vime

2001-11-15, 9:01 am

I have 8000 rows of data. They are some duplicate rows but do not know the SQL statement to find out the duplicates(about 250).

Any ideas

Thanks
colinbun

2001-11-22, 9:17 am

There are a few ways to do this, the easiest depends on the number of fields in the table. One way, if you have 2 fields, is -

select fieldA,fieldB,count(*) from table group by fieldA,fieldB having count(*) > 1

Hope this helps,
Colin
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net