Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find Duplicates
Message
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:
01493185
Views:
65
>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.

Sample with Northwind Database:
OPEN DATABASE (HOME(2) + "Northwind\Northwind")
SELECT * ;
  FROM Territories T1;
  WHERE EXISTS ;
  (SELECT * ;
  FROM Territories T2 ;
  WHERE T1.TerritoryDescription = T2.TerritoryDescription ;
  GROUP BY T2.TerritoryDescription ;
  HAVING COUNT(*) > 1)
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform