SELECT *
FROM 
(
select 1 as p00, 
       nr01 as nr01, 
       if(p02='', p01, p02)  as p02
FROM a97 

UNION ALL 

select 2 as p00, 
       nr01 as nr01, 
       if(p02='', p01, p02)  as p02
FROM a98 

UNION ALL 

select 3 as p00, 
       nr01 as nr01, 
       if(p02='', p01, p02)  as p02
FROM a99

UNION ALL 

select 4 as p00, 
       nr01 as nr01, 
       if(p02='', p01, p02)  as p02
FROM i99  

UNION ALL 

select 5 as p00, 
       p01 as nr01, 
       p02  as p02
FROM i13  

) as tabl01
ORDER BY p00, nr01;