Leo Torres
asked on
Outer Join
I have two tables that are linked by Item, Client, Country
The query below returns a lot of Nulls. There are some records that are in one table and not in the other for both tables.
I still need to know the Item, Client, Country, Description, but it returns Null instead of the info for those fields
Any suggustions, Im not even sure I can post this here please advise if I need to post else where
Thank you!!!
The query below returns a lot of Nulls. There are some records that are in one table and not in the other for both tables.
I still need to know the Item, Client, Country, Description, but it returns Null instead of the info for those fields
Any suggustions, Im not even sure I can post this here please advise if I need to post else where
Thank you!!!
Select AF.* from
(select F.COUNTRY,F.Client,F.ITEM,F.Description
from Actual2 A full outer Join Forecast2 F on (A.Item = F.Item and A.CLIENT = F.Client and A.COUNTRY = F.Country) ) as AF
ASKER
I get the same result as mine I am still missing the Cleints and info from the Forecast table?? I need to display info from both tables even if there's no match.. This only shows Actual table results that match Forecast..
select A.COUNTRY,A.Client,A.ITEM, F.Descript ion
from Actual2 A LEFT outer Join Forecast2 F on A.Item = F.Item and A.CLIENT = F.Client and A.COUNTRY = F.Country
union
select A.COUNTRY,A.Client,A.ITEM, F.Descript ion
from Actual2 A RIGHT outer Join Forecast2 F on A.Item = F.Item and A.CLIENT = F.Client and A.COUNTRY = F.Country
from Actual2 A LEFT outer Join Forecast2 F on A.Item = F.Item and A.CLIENT = F.Client and A.COUNTRY = F.Country
union
select A.COUNTRY,A.Client,A.ITEM,
from Actual2 A RIGHT outer Join Forecast2 F on A.Item = F.Item and A.CLIENT = F.Client and A.COUNTRY = F.Country
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
from Actual2 A LEFT outer Join Forecast2 F on A.Item = F.Item and A.CLIENT = F.Client and A.COUNTRY = F.Country