Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find Duplicates
Message
De
18/12/2010 06:01:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01493182
Message ID:
01493203
Vues:
62
>I am having a heckuva time trying to find duplicates in a client's table. It seems that they've had some corruption in their database as well, so I used VALIDATE DATABASE, which gave me a clue that their primary key wasn't in synch with referential integrity.
>
>Isn't there a simple SQL statement I can use to find the dupes? This table is huge.

If the primary key is called MyPrimary, I would use something like this:
select MyPrimary, count(*) as HowMany;
  from MyTable;
  group by MyPrimary;
  having HowMany > 1
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform