Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Dups based on Three Fields
Message
From
05/06/2006 18:21:26
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
05/06/2006 17:39:27
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01127219
Message ID:
01127225
Views:
9
>I have a table which has three fields in which the data can be duplicated(keeps detail records with unique record numbers) ....I have records with the first two fields matching and the third not. What kind of select statement can I write to find these records and correct them?

Hi Steven,

Use code like this:
Select ;
  Field1, Field2, Count(Distinct Field3) ;
  From Table ;
  Group By Field1, Field2 ;
  Having Count(Distinct Field3) > 1
After that I'd set a relation from the result into the table, step through it, and correct/delete whatever you want.
Previous
Reply
Map
View

Click here to load this message in the networking platform