Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to check a table for duplicates???
Message
De
12/02/2002 15:36:22
 
 
À
12/02/2002 15:28:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00619081
Message ID:
00619086
Vues:
17
select *, sum(cost) as totcost from sales group by custid having cnt(*) > 1 into cursor ordersummary
index on custid tag custid
select sales
set relation to custid into ordersummary
replace all cost with ordersummary.totcost


***** that was off the top of my head, it doesn't remove the duplicates, and it has never been tested, probably some typos and other errors in it. you get the concept though, I hope?

select * from sales group by custid into cursor ordersummary
select sales
delete all
pack
append from dbf("ordersummary")


**** might be the sort of thing you need to do to remove the duplicates. Gives you some commands to work with anyway :)
--Todd Sherman
-Wake Up! Smell the Coffee!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform