select
      a38.p01  as t_p01,
      i00.name as vt_p01,
      sum(a38.p04) as t_p04,
      sum(a38.p041) as t_p041,
      a38.p010 as t_p010
FROM a38
LEFT JOIN i00 ON i00.pno=a38.p01
WHERE a38.p00={nnr01}
GROUP BY a38.p01, a38.p010;