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!

Duplicate records

Status
Not open for further replies.

smithcza

Programmer
Jan 7, 2005
80
ZA
Hi all

How can I find if I have duplicate records in a table?

Regards,

SmithcZA
 
something like this would identify them. If you want to delete them, there needs to be a way to tell which rows you want to keep.

Code:
select [UniqueColumn]
, count([UniqueColumn])
from YourTable
group by [UniqueColumn]
having count([UniqueColumn]) > 1

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top