This example uses the customer table from Tastrade
[tt]USE ADDBS(_SAMPLES)+"tastrade\data\customer"[/tt]
Find duplicate fields
General syntax:
[tt]SELECT COUNT(MyField) - 1 as Dupes, MyField ;
FROM MyTable ;
GROUP BY MyField ;
HAVING COUNT(MyField) > 1 ;
ORDER BY Dupes DESCENDING ;
INTO CURSOR cDuplicates[/tt]
Example:[tt]
SELE COUNT(country) - 1 as Dupes, country ;
FROM customer ;
HAVING COUNT(country) > 1 ;
ORDER BY Dupes DESC ;
GROUP BY country[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.