create temporary table t
select
"T1" as source,Custid,yearid,amount
from table1;
insert into t
select
"T2" as source,Custid,yearid,amount
from table2;
insert into t
"T3" as source,Custid,yearid,amount
from table3;
insert into t
"T4" as source,Custid,yearid,amount
from table4;
select...