Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Join Parent with 2 child Tables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01552239
Message ID:
01552320
Vues:
52
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform