SELECT 1 as i00_update,
       ifnull(i17.nr01, 0) as i17nr01, 
       ifnull(i17.pe02, 0) as i17pe02, 
       ifnull(i17.pe03, 0) as i17pe03, 
       ifnull(i17.pe04, 0) as i17pe04,
       tabl01.*
FROM ({peg_str}) as tabl01
LEFT JOIN i17 ON i17.pe01=tabl01.pno
              && i17.pe02={np_eid}
WHERE ifnull(tabl01.vp_ypol, 0)>={np_ypol1}
   && ifnull(tabl01.vp_ypol, 0)<={np_ypol2}
   && ifnull(tabl01.vp_lypol, 0)>={np_lypol1}
   && ifnull(tabl01.vp_lypol, 0)<={np_lypol2};      
       