Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>I have a table with the following fields:
>
>city
>state
>county
>territory
>
>There are several thousand records. I want to get rid of all of the duplicates; Just have one record for each unique record.
>
>Does anyone have an example of code that would go through the table and mark all but one of all duplicate records for deletion?
You might try something like
INDEX ON city+state+county+territory UNIQUE TAG myTag
SET ORDER TO
DELETE ALL
SET ORDER TO myTag
RECALL ALL
DELETE TAT myTag
That seemed to work in my quick and dirty test.
.......Rich
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement