A UNION ALL statement is used to combine two data streams. The fields of the two data streams must be the same in terms of the field type and sequence.
Syntax
select_statement
UNION ALL
select_statement;
Example
SELECT
a,
sum(b),
FROM
(SELECT * from tb_1
UNION ALL
SELECT * from tb_2
)t
GROUP BY a;