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

 

内容来源于网络如有侵权请私信删除

文章来源: 博客园

原文链接: https://www.cnblogs.com/wml-it/p/13703853.html

你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!