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