SELECT cona13.p02 as p01, 
       sum(ifnull(d38.p02, 0)) as p02
FROM cona13
LEFT JOIN d38 ON d38.p04=cona13.nr01
              && d38.nr01<>0
              && d38.nr01<>{nt_nr01}
WHERE cona13.nr01={nt_p04}
GROUP BY cona13.nr01;
