Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query help(list recurring records in a DB)
Message
 
 
À
22/04/2010 12:51:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01461504
Message ID:
01461528
Vues:
36
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform