Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Want to remove duplicates from a table
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00406787
Message ID:
00406845
Views:
40
it deleted ones that do not have duplicates. i would like to keep any records that do not have duplicates.

brenda


>select keyid, lastname+firstname customer, count(lastname+firstname), max(add_date) from mytable group by 2 having count(lastname+firstname) > 1 into cursor crsTemp

>delete from mytable where lastname+firstname in (select customer from crsTemp) and keyid not in (select keyid from crsTemp)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform