Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL selecting duplicate records
Message
De
02/03/1998 11:05:10
 
 
À
02/03/1998 10:57:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00082085
Message ID:
00082091
Vues:
28
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform