General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only