Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Identifying duplicate records
Message
De
16/02/2000 14:59:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/02/2000 11:43:00
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00332926
Message ID:
00333057
Vues:
13
>I know that I could code a way to do this, but is there a simple way that I have overlooked?
>I need to identify all of the duplicates in a medium-size database, so that a human can look them over for possible deletion. Set UNIQUE on won't help in this case.
>I'm guessing that I have to scan and run loops to check for the dups and then send them to another file. Any better ideas?
>
>
>TIA,
>
>
>Ed


Ed,
Depends on how you define a duplicate.
If a duplicate is something that all fields match you could SQL union a table by itself.
If a field or field combination defines duplicate you could narrow SQL to those fields.
Another yet powerfull fox2x way is to relate the table by itself :
use myTable alias "copy1"
use myTable in 0 again alias "copy2" order tag DupFieldIdentifyingTag descending
* Copy 2 is used in descending order - so if same key exists in both
* and recno()s differ than copy2 is on one of duplicated records
set relation to myDupFieldCombination into copy2
browse for recno("copy1") # recno("copy2") && Editable browse dupcheck
Cetin


function Copy2SecondRec
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform