Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to check a table for duplicates???
Message
From
12/02/2002 15:36:22
 
 
To
12/02/2002 15:28:14
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00619081
Message ID:
00619086
Views:
15
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!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform