select table1.id newid,table1.name newname,newamount=0 from table1
union
select table2.id newid,table2.name newname,table2.amount newamount from table1,table2 where table1.id=table2.id
union
select table2.id newid,table2.name newname,table2.amount newamount from table1,table2 where table1.id=table2.id
(select id,name,0 amount,1 idx from table1
unino
select id,name,amount,2 idx from table2)aaa
order by id,idx