Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select
Message
 
 
To
19/01/2002 22:58:24
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00607394
Message ID:
00607451
Views:
28
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform