Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Showing Only Duplicates
Message
From
01/12/2001 12:00:04
Carmen Gassi
Perseus Software Systems
Oakville, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00588383
Message ID:
00588399
Views:
22
>>I thank all in advance for any help. I have been asked to provide a screen lookup, or browse window where the user would like to filter and show only the records where a specific field has duplicates. Is it possible to do in an SQL, or do I have to write a function to extract the duplicates first, then simply browse those?
>
>Hi Carmen,
>If you want only display duplicates than
SELECT * FROM mytable ;
>  WHERE KeyField1 IN ( ;
>    SELECT KeyField1 FROM mytable GROUP BY 1 HAVING COUNT(*) > 1 ) ;
>  INTO CURSOR crsDups
Sergey
Thank you for your quick and helpful response. With modification to order the cursor by a key field, the sql command works perfectly. Again, many thanks.

Regards
Carmen
Previous
Reply
Map
View

Click here to load this message in the networking platform