Writing SQL code to delete duplicate records

Joined
Nov 30, 2012
Messages
3
Reaction score
0
I am hoping someone might be able to help. I have a database that I am trying to delete the duplicate records (there is no way to stop these as its from an excel spread sheet that has over 70,000 records)
I have created a couple of queries using SQL to get the total number to around 1400 records, however there are still duplicates where a customer has entered the postcode for instance with and then again without a space inbetween.
What I was hoping for, is to do a SQL query to delete all duplicate records searching on the First Name, Surname and postcode, however I need it to show the results with all columns (Title, First Name, Surname, Address, Address2, Town/City, County, Postcode)
I have that this makes sense to someone as I have been searching everywhere for an answer, but nothing really makes sense (as this is the first time I have started using SQL coding so I am a complete novice when it comes to this.
I am currently using Microsoft Access 2010
Thank you in advance!!
 
Joined
Oct 23, 2012
Messages
29
Reaction score
0
to tell the truth i tried it so many times but eventually added it to my VB.net Project as i was programming project, at first i wanted to remove dublicates from my table using query , but it didn't work, so i added it to the project as sql statements and VB.net functions ,, only to remove duplicates
 
Joined
Jul 22, 2010
Messages
2
Reaction score
0
You need to use a GROUP BY statement, followed by a condition using HAVING COUNT > 1 to match duplicate rows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top