Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I eliminate dup record that has blank child recor
Message
 
À
06/04/2005 13:10:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Divers
Thread ID:
01001983
Message ID:
01002646
Vues:
15
>>I am trying to eliminate duplicate records on couple of tables that are linked by relationship. I have a parent table called arcperson and a child table called arcpinfo. both tables are linked by field call personid. In my parent table arcperson I have a couple of fields called lname (last name) and fname (first name). I what to find all duplicates of lastname+firstname and then if any of these name don't have any data in the child table arcpinfo, I want to delete that parent and child record. My problem is how can I find duplicate records on lname and fname and also see if any records or blank records exist in child table. Here is something I tried but didn't workout as far as finding duplicate names:
>>
>>
>>SET ORDER TO NAMES   && LNAME+FNAME
>>SELECT lname, fname, count(*) as CntDups FROM arc_person GROUP BY 1 HAVING CntDups > 1 INTO CURSOR test
>>
>>
>>this gave me an error on grouping.
>>I'm not sure if I am on the right track. any help appreciated.
>>
>>thanks
>>Nick
>
>
>SELECT lname, fname, count(*) as CntDups FROM arc_person GROUP BY 1,2 HAVING CntDups > 1
>
thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform