Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql to find duplicates
Message
From
17/07/2003 12:08:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00811118
Message ID:
00811129
Views:
8
>>>Hi,
>>>Can someone help me with the SQL to find all duplicates in a field?
>>>Thanks,
>>>Allen
>>
select KeyFld, count(*) as CntDups from TestDups group by 1 ;
>>     having CntDups > 1 ;
>>     into cursor curDupes
>>
>
>Sorry but I did get it...
>Keyfld for me is lineitems_id
>TestDups table is lineitems
>What's CntDups... a variable?
>
>Allen

When selecting an expression, it is best to give it a name, instead of having VFP assign one automatically. Sergey decided to name this field CntDups (count duplicates).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform