query I rowsort
select 1 union select 2
----
1
2

query I rowsort
select 1 union select 2 + 1
----
1
3

query I rowsort
select 1 union select 1
----
1

query I rowsort
select 1 union all select 1
----
1
1

query T
select (1, 2) union select (2, 1) union select (1, 2)
----
(1, 2)
(2, 1)

statement ok
create table t1(id int primary key, v1 int unique)

statement ok
insert into t1 values (1,1), (2,2), (3,3), (4,4)

query I
select v1 from t1 union select * from t1
1
2
3
4

query I rowsort
select v1 from t1 union all select * from t1
1
1
2
2
3
3
4
4

statement ok
drop t1