Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate Record Program
Message
 
 
À
13/01/2002 18:40:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00604127
Message ID:
00604132
Vues:
26
This message has been marked as the solution to the initial question of the thread.
You can use code like this
lcTableName = < table name >
SELECT (lcTableName)
lcGroup = "1"
FOR lnI = 2 TO FCOUNT()
  IF NOT INLIST(TYPE(FIELD(lnI)), "M", "G")
    lcGroup = lcGroup + "," + TRANSFORM(lnI)
  ENDIF	
ENDFOR

SELECT *, COUNT(*) ;
	FROM (lcTableName) ;
	GROUP BY &lcGroup ;
	HAVING count(*) > 1
>How should one execute a search in VFP for duplicate records knowing only the table name?
>
>I do not know how to pull the field names into the following pseudo-code:
>
>select *, count(*) as cnt from TABLE_NAME;
>group by [ALL THE FIELD NAMES];
>having count(*)>1
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform