Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace record from other dbf
Message
De
11/03/2005 12:13:53
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00994807
Message ID:
00994891
Vues:
17
Dear Khubaib

Put one the following routines to delete duplicate records

Example 1

valid procedure for Txtcustid:
cCustid = Alltr(this.value)
Select("Customers")
Set order to tag CUSTID
GO TOP
IF !EOF() .OR. !BOF()
Set Exact on
Seek(cCustid)
If Seek(cCustid)
Messagebox("Duplicate records or records exist!",0+16,"Add",1900)
return 0
Endif
Set exact off
Endif

EXE 2

SELECT * ;FROM table A ;WHERE EXISTS ; ( SELECT * ; FROM table B ; WHERE B.key = A.key; GROUP BY key ; HAVING COUNT(*) > 1 ) ;ORDER BY fieldlist
or
SELECT * ;FROM table ;WHERE key IN ; ( SELECT key ; FROM table ; GROUP BY key ; HAVING count(*) > 1) ;ORDER BY fieldlist

Exe – 3

To find number of dulplicates use following line:

SELECT COUNT(*) FROM myTable GROUP BY myKeyField_or_myExpression HAVING COUNT(*) > 1

Wish you good luck
Allah Hafiz
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform