UNION ALL 语句将两个流式数据合并。要求两个流式数据的字段完全一致,包括字段类型和字段顺序。

语法

select_statement
UNION ALL
select_statement;

示例

SELECT
    a,
    sum(b),
FROM 
    (SELECT * from tb_1
    UNION ALL
    SELECT * from tb_2
    )t
 GROUP BY a;