UNION:去除重複記錄,例如:SELECT FROM t1 UNION SELECT FROM t2
UNION ALL:不去除重複記錄,例如:SELECT FROM t1 UNION ALL SELECT FROM t2
create table A(
name varchar(10),
score int
);
create table B(
name varchar(10),
score int
);
insert into A values('a',10),('b',20),('c',30);
insert into B values('a',10),('b',20),('d',40);