Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Want to remove duplicates from a table
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00406787
Message ID:
00406868
Vues:
32
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform