是否有可能将 "same" 属性从不同的表中获取到一列中?

IS there a possibility to get the "same" attribute into one column from different tables?

所以我有两个 table 有一个主键 month_cd:

Table答:

month_cd stuff stuff2
First 1 null
Second 2 null
Third null 2

Table乙:

month_cd stuff stuff2
First null 2
Third 3 null
Fourth 4 3

我需要它们在第三个 table C 中看起来像这样。

Table C:

month_cd stuff stuff2
First 1 2
Second 2 null
Third 3 2
Fourth 4 3

我尝试使用 coalesce(A.month_cd, B.month_cd, C.month_cd)[=40 进行 完全外连接 =],但为什么它给了我双打

Table C:

month_cd stuff stuff2
First 1 null
First null 2
Second 2 null
Third 3 null
Third null 2
Fourth 4 3

事实上,完整的外部联接应该在这里起作用:

SELECT
    COALESCE(a.month_cd, b.month_cd) AS month_cd,
    COALESCE(a.stuff, b.stuff) AS stuff,
    COALESCE(a.stuff2, b.stuff2) AS stuff2
FROM TableA a
FULL OUTER JOIN TableB b
    ON b.month_cd = a.month_cd;