Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find Duplicates
Message
From
18/12/2010 06:01:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01493182
Message ID:
01493203
Views:
61
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform