Table OPP
OppA Channel1 Value1
OppA Channel2 Value2
OppA Channel3 Value3
Table Source
OppA Channel1 Value4
OppA Channel2 Value5
OppA Channel4 Value6
Desired outcome:
OppA Channel1 Value1 Value4
OppA Channel2 Value2 Value5
OppA Channel3 Value3 null
OppA Channel4 null Value6
I thought I would get my result by doing the join
Select OppName, Channel, OppValue, SourceValue
from Opp
full join Source on Opp.OppName = Source.SourceName and OppChannel = SourceChannel
When that didn't work I tried
Select OppName, Channel, OppValue, SourceValue
from Opp
full outer join Source on OppChannel = SourceChannel
where Opp.OppName=OppA and Source.OppName=OppA
But either way I only get 2 rows returned. (The two rows with no null values)
Please help! (and, thanks in advance)