Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for Duplicates
Message
From
28/11/2003 10:26:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00854192
Message ID:
00854210
Views:
31
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>I'm trying to write a routine to identify duplicate records. I have a select statement that uses certain criteria to compare each record with all the others in the table. This seems to work but foreach record that produces a match I also get a match when I get to the matched record a compare that. Is there some way to prevent this?
>
>My results look something like
>id1 id2
>1   2
>2   1
>All I really want in this instance is one entry.
>This is the select statement
>SELECT Addresses.iid, Addresses_a.iid;
> FROM duplicates!addresses, duplicates!addresses Addresses_a;
> WHERE Addresses.iid <> Addresses_a.iid;
>   AND Addresses.csurname == Addresses_a.csurname;
>   AND Addresses.cforename == Addresses_a.cforename;
>   AND (Addresses.caddress_1 == Addresses_a.caddress_1;
>   OR (Addresses.cpostcode == Addresses_a.cpostcode));
> ORDER BY Addresses.csurname, Addresses.cforename
>
>Many thanks in anticipation.

Caroline,
Addresses.iid < Addresses_a.iid ?
Cetin
Ç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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform