full join 空值填充

full join 空值填充

SELECT   coalesce( NULL , 0) as tianchong FROM DUAL 

SELECT   coalesce( '' , '0') as tianchong FROM DUAL 

 

SELECT A.M, coalesce(B.N, 'X') AS N
  FROM (SELECT 0 AS M
          FROM DUAL
        UNION
        SELECT 1 AS M
          FROM DUAL
        UNION
        SELECT 2 AS M
          FROM DUAL
        UNION
        SELECT 3 AS M FROM DUAL) A
  FULL JOIN (SELECT 0 AS M, '0' AS N FROM DUAL) B
    ON A.M = B.M

 

posted @ 2020-12-02 18:43  码农阿亮  阅读(735)  评论(0编辑  收藏  举报