Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shorter way
Message
 
 
To
08/04/2011 12:15:21
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
01506660
Message ID:
01506662
Views:
88
>I have a table MyCust.dbf with the records:
>
>
>Cust_id
>-------
>00001
>00001
>00001
>00002
>00003
>00002
>
>
>what is the shorter way to delete all those double entries, so each ID only has one records?
>
>thanks for the help
>
>Jerry

Try
Use myCust.dbf exclusive
select Cust_ID from myCust group by Cust_ID into table MyTempCust 
if _tally > 0
   zap in myCust
   insert into myCust select * from myTempCust
endif
delete file MyTempCust.dbf
catch to loException
   && Handle it here
endtry
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform