Link to home
Start Free TrialLog in
Avatar of Leo Torres
Leo TorresFlag for United States of America

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!!!
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

Open in new window

Avatar of Aneesh
Aneesh
Flag of Canada image

select A.COUNTRY,A.Client,A.ITEM,F.Description
from Actual2 A LEFT  outer Join Forecast2 F on A.Item = F.Item and A.CLIENT = F.Client and A.COUNTRY = F.Country
Avatar of Leo Torres

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.Description
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.Description
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
Avatar of Leo Torres
Leo Torres
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial