Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>I thank you for the suggestions. I currently have tried all of them. The best one that I found, which worked for this purpose, was from both Dore and Ken. The question that I have is there a way to keep everything in the same table without having to copy to a new table? Basically, the process everything is going through is via a REINDEXing program.
>
>Weekly, the records of this table (386,548 records)are being reindexed, but many of them are duplicate invoice no. (i.e. J123451 has 6 of the same records). I want to keep the first records and delete all proceeding records of the same invoice number. While I wish we could have a candidate key to prevent this, it's not the company's interest.
>
>Just for my knowing, would this be the most optimized process of clearing out deleted records?
>
>Thanks again for the help!!
use table in 0
use table again alias dupes in 0
select dupes
set order to primarykey
select table
set relation to primarykey into dupes
delete for recno() != recno("dupes")
set relation to
use in dupes
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