SELECT tb1.id_customer,tb1.name,tb2.num_a FROM T_customer tb1
INNER JOIN T_A tb2 ON tb1.id_customer=tb2.id_customer
LEFT JOIN T_B tb3 ON tb1.id_cutomer=tb3.id_customer
SELECT @rowno:=@rowno+1 id_run,id_customer, name, num_
FROM (
select id_customer, num_a from table_a
union all
select id_customer, num_b from table_b
) as uni
, tablename as tb
, (select @rowno:=0) as rn
where tb.id_customer = uni.id_customer
SELECT @rowno:=@rowno+1 id_run,id_customer, name, num_
FROM (
select id_customer, num_a from table_a
union all
select id_customer, num_b from table_b
) as uni
, tablename as tb
, (select @rowno:=0) as rn
where tb.id_customer = uni.id_customer