select ifnull(tran02.p00_1, 0) as p00,
       ifnull(tran01.nr01, 0) as nr01, 
       /*date*/
       cast(ifnull(tran01.p014, '01000101') as date) as p01,   
       /*D.A.*/
       ifnull(tran02.p01, '') as p02,                      
       /*Nr*/
       concat(tran01.sp00, tran01.p00) as p03, 
       /*Remarks*/
       ifnull(tran01.p104, '') as p04, 
       /*From*/
       ifnull(tran05.p02, '') as p05, 
       /*Receiver*/
       ifnull(d00.p19, '') as p06, 
       /*To*/
       ifnull(tran05.p03, '') as p07, 
       /*Eidos*/
       ifnull(tran02.p04, '') as p08, 
       /*Sysk*/
       ifnull(tran02.p03, '') as p09, 
       /*Plithos*/
       ifnull(tran02.p02, 0)  as p010, 
       /*Oxhma*/
       ifnull(tran06.p01, '')  as p011 
       
FROM i01
LEFT JOIN tran01 ON tran01.nr01 = i01.pd102
LEFT JOIN tran02 ON tran02.p00=tran01.nr01
LEFT JOIN tran05 ON tran05.p00=tran01.p701
LEFT JOIN tran06 ON tran06.p00=tran01.p702
LEFT JOIN d00 ON d00.nr01=tran01.p02

WHERE i01.p06={nnr01}
   && i01.p07=2
   && i01.pd101='tran01';