Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Join Parent with 2 child Tables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01552239
Message ID:
01552320
Views:
51
Hi Naomi. Thanks for that.
I am going to give the simple Union join a go.. it's simple and will require least amount of chnge to my app
Regards
Gerard

>>Hi.
>>Is there a way , with one select statement, to join a Parent with two Child Tables, without doing an outer join (I dont want to end up with Nulls)
>>
>>So I want an inner join as in (Select * from Master join (Child1 / Child2) on MasterKey = ChildKey
>>Both Child Tables have identical structure.
>>Say I have a Parent Country Table, (Ctry c(10) ) with two child tables for each year 2011, 2012 (childFK c(10), Salesqty n(12) )
>>
>>I want to select Out from Parent Table and (Chi2011 / Chi2012) and end up with a Table where there is a match between the parent and EITHER of the children. So I want to end up with all the fields from the parent and all the fields from Child (Child2011 or Child2012)
>>
>>Tia
>>Regards,
>>Gerard
>
>Assuming it's always a match between either of the children, use LEFT JOIN with both children and put fields from children into COALESCE (SQL Server) OR NVL (Visual FoxPro) function, so it will select one or the other whatever is not null.
Previous
Reply
Map
View

Click here to load this message in the networking platform