--
-- ### View with union select 
--

drop if exists table t1;
create table t1 ( a int, b string(30));
drop if exists table t2;
create table t2 ( c int, d string(30));
drop if exists table t3;
create table t3 ( e int, f string(30));

insert into t1 values ( 1, 'XXX');
insert into t1 values ( 2, 'XXX');
insert into t1 values ( 3, 'XXX');
insert into t1 values ( 8, 'XXX');
insert into t1 values ( 9, 'XXX');

insert into t2 values ( 9, 'X');
insert into t2 values ( 9, 'X');
insert into t2 values ( 9, 'X');

insert into t3 values ( 10, 'SSS');
insert into t3 values ( 10, 'SSS');
insert into t3 values ( 10, 'SSS');
insert into t3 values ( 10, 'SSS');
insert into t3 values ( 10, 'SSS');


drop if exists view v1;
create view v1 as select a, b  from t1 union all select c as a, d as b from t2 union all select e as a, f as b from t3;

select * from v1;

drop view v1;
