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:
00406868
Views:
31
>select keyid, lname+fname customer, count(lname+fname), max(add_date) add_date ;
from newstates ;
group by 2 ;
into cursor crsTemp

>select a.lname+a.fname customer, a.keyid, a.add_date ;
from newstates a, crsTemp b ;
where a.lname+a.fname = b.customer and a.add_date = b.add_date ;
order by a.lname, a.fname ;
into cursor crsTemp2

>delete from newstates where keyid not in (select keyid from crsTemp2)

really appreciate the help. but just a little confused about what is keyid? in my case what i am calling the key is lname,fname, and the add_date is the tie breaker.

brenda
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform