SELECT ifnull(i00.pno, '') as p01, 
       ifnull(a01.p06, 0) as p02, 
       ifnull(a01.nr01, 0) as p03, 
       ifnull(a01.p48, 0) as p05, 
       ifnull(i00.timh1, 0) as p06, 
       ifnull(i00.timh2, 0) as p07, 
       ifnull(i00.timh3, 0) as p08, 
       ifnull(i00.timh4, 0) as p09, 
       ifnull(i00.p9901, 0) as p10
FROM f00
LEFT JOIN a01 ON a01.nr01={peg_arr[1]}
LEFT JOIN i00 ON i00.pno='{peg_arr[2]}'
WHERE f00.nr01=1;