Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Help?
Message
De
17/08/1997 01:57:49
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
14/08/1997 21:39:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00044834
Message ID:
00045153
Vues:
34
> > Can someone help me with the SQL to find duplicate records in a table where > a duplicate is considered two out of five matching fields? I thought: > SELECT * ; > FROM table; > WHERE keyfield IN ; > (SELECT keyfield ; > FROM tablel ; > GROUP BY keyfield, field2; > HAVING count(*) > 1) > would do the trick, but it doesn't work. TIA > > Erik SELECT * ; FROM table; WHERE keyfield IN ; (SELECT keyfield, count(*) as cnt ; FROM tablel ; GROUP BY keyfield, field2; HAVING cnt > 1) ....but then, I've never done this, to have two fields in a subquery used for Where ... in ( ). Maybe it could give you some extra records, if keyfield is numeric and equal to number of appearances in table1. Really, what does SQL do in this case? Does it compare table.keyfield with subquery.keyfield only, or compares it with subquery.cnt too?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform