I have a table > 500,000 rows where there are duplicate entries that need to be removed but only where a few columns match.
The main table has the following columns
id,
countryID,
postalCode,
adminName1,
adminName2,
placeName,
adminName3,
latitude,
longitude
I need to remove duplicates (leaving the first record) where placeName, latitude & longitude match
I had a search and found this which looks right but doesnt work for me. I have duplicated the original table structure into a new table (tblTemp)
INSERT INTO tblTemp(id,countryID,postalCode,adminName1,adminName2,placeName,adminName3,latitude,longitude)
SELECT DISTINCT placeName,latitude,longitude
FROM tblCountry_admin;
But i get the error
Column count doesn't match value count at row 1