表opp
OppA Channel1 Value1
OppA Channel2 Value2
OppA Channel3 Value3
表源
OppA Channel1 Value4
OppA Channel2 Value5
OppA Channel4 Value6
预期结果:
OppA Channel1 Value1 Value4
OppA Channel2 Value2 Value5
OppA Channel3 Value3 null
OppA Channel4 null Value6
我想我会通过加入得到我的结果
Select OppName, Channel, OppValue, SourceValue
from Opp
full join Source on Opp.OppName = Source.SourceName and OppChannel = SourceChannel
当那没用的时候我试过了
Select OppName, Channel, OppValue, SourceValue
from Opp
full outer join Source on OppChannel = SourceChannel
where Opp.OppName=OppA and Source.OppName=OppA
但不管怎样,我只得到2行返回(没有空值的两行)
请帮帮我((提前谢谢)
1条答案
按热度按时间ogsagwnx1#
我想你只需要处理一下
NULL
价值观: