Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for Duplicates
Message
De
30/11/2003 15:50:06
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00854192
Message ID:
00854564
Vues:
23
This message has been marked as a message which has helped to the initial question of the thread.
Hi Caroline,

How about something like this:

SELECT a.iid, b.iid as iid__duplicate;
FROM duplicates!addresses a, duplicates!addresses b;
WHERE b.iid > a.iid;
AND a.csurname == b.csurname;
AND a.cforename == b.cforename;
AND (a.caddress_1 == b.caddress_1;
OR (a.cpostcode == b.cpostcode));
ORDER BY a.csurname, a.cforename, a.iid

This should result in:

iid iid__duplicate

1 2
1 3
2 3

The key difference is using > vs. <>.

When I use a similar approach, I assume that newer rows have a higher value for the UID, but I think it works regardless.

HTH

Blue Skies!

Joe
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform