Multiple FULL OUTER JOIN on multiple tables

前端 未结 5 1837
暗喜
暗喜 2020-12-23 20:36

I have multiple outer joins

SELECT  A.column2
        , B.column2
        , C.column2
FROM 
(
    (SELECT month, column2 FROM table1) A
    FULL OUTER JOIN
          


        
5条回答
  •  有刺的猬
    2020-12-23 21:18

    SELECT  A.column2
            , B.column2
            , C.column2
    FROM 
    (
        (SELECT month, column2 FROM table1) A
        FULL OUTER JOIN
        (SELECT month, column2 FROM table2) B on A.month= B.month
        FULL OUTER JOIN 
        (SELECT month, column2 FROM table3) C on ISNULL(A.month, B.month) = C.month
    )
    

提交回复
热议问题