Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select
Message
 
 
À
19/01/2002 22:58:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00607394
Message ID:
00607451
Vues:
30
select fieldlist ;
   from Parent ;
       left join Child1 ;
            on Parent.KeyID = Child1.Parent_ID ;
       left join Child2 ;
            on Parent.KeyID = Child2.Parent_ID ;
       left join Child3 ;
            on Parent.KeyID = Child3.Parent_ID ;
       left join Child4 ;
            on Parent.KeyID = Child4.Parent_ID ;
   where some_conditions ;
   group by ... ;
   order by ... ;
   into cursor crsResults
>I am wanting to build a report based on parent table and all related records
>in 4 child tables. Some child tables might not have related records
>so I would just want the emtpy or null value for the field I am trying to get from it.
>Can 1 sql statement do this or will i have to build one cursor with key field and loop through each child table and populated report table?
>I am trying inner/outer joins but if all criteria does not match, nothing
>is pulled into query?
>
>Any help would be greatly appreciated.. (also some resources on bulding SQL select statements!)
>
>Thanks,
>Ronnie
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform