Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to check a table for duplicates???
Message
From
12/02/2002 16:52:02
 
 
To
12/02/2002 15:53:27
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00619081
Message ID:
00619170
Views:
16
Sunshine,
Bryan's solution should still work even if you don't have a PK. Simply list all the fields in the GROUP BY clause:
SELECT * FROM < TableToCheck > GROUP BY dob, last_name, first_name HAVING COUNT(*) > 1 INTO CURSOR dupes
HTH
>If I had a primary field my life would be so much easier! To find duplicate records, I need to compare the dob,last_name, and first_name.
>
>This is why I was going to use 2 tables i.e. select * from table1,table2 where table1.dob = table2.dob and table1.lastname= table2.lastname and table1.firstname = table2.firstname.
>
>Sunshine
>
>P.S. Thanks for your response!
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform