Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I eliminate dup record that has blank child recor
Message
From
06/04/2005 13:10:23
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01001983
Message ID:
01001993
Views:
18
>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 
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform