Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL selecting duplicate records
Message
From
02/03/1998 11:05:10
 
 
To
02/03/1998 10:57:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00082085
Message ID:
00082091
Views:
24
Hi Greg,

Assuming your primary key is ID, you can find a list of the duplicates using:

SELECT id, COUNT( id) FROM ( table) GROUP BY id HAVING COUNT( id) > 1

This will return a list of all the records where the primary key appears at least twice. You could then set a relation to this file from the original to see the actual data.

Ian

>I need help writing the sql to return all the duplicate records in a table. The key fields are author and title and I need all the duplicates returned. If there is a duplicate record I need to see both. Any help would be appreciated.
regards

Ian
Previous
Reply
Map
View

Click here to load this message in the networking platform