Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for Duplicates
Message
From
30/11/2003 15:50:06
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00854192
Message ID:
00854564
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform