>>Can you show what exactly did you write? The query as I posted (even if posted from the top of my head) should have worked just fine.
>
>
>
>can you tell me about this inner join thou?
>
>inner join (select FName, count(*) as NumRec from oTest group by FName having count(*) > 1) Dup
>
>
>It takes all the names from Otest and Dup whose count is more than 1?
Yes. If it's easier for you, let's do in 2 steps:
Step 1. Select FName, count(*) as NumRec from OTest group by FName having count(*) > 1 into cursor curDups
Step 2. Select OTest.*, curDups.NumRec from OTest INNER JOIN curDups on OTest.FName = CurDups.FName
In my query from the very first message I just combined these two steps into one query using the technique called derived table technique (available in VFP 9 only).
If it's not broken, fix it until it is.
My Blog