Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not to select records in the many table
Message
De
20/01/2009 10:03:40
 
 
À
20/01/2009 09:59:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01375445
Message ID:
01375448
Vues:
11
>Hi,
>I have two tables with one-to-many relation.
>Is there a way - in one sql statement - to count all the records
>which have only one record relation in the "many" table.
>
>Thanks.

Untested:
SELECT PKinOneTable ;
   FROM TheManyTable ;
   GROUP BY PKinOneTable ;
   HAVING CNT(*) = 1 ;
   INTO CURSOR OnlyOneChild
Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform