/********************************
      a60
********************************/
/* i01->a60 */
INSERT INTO a60 
(nr01, p01, p08, p06, 
remfdate, remftime, remfuser, remdate, remtime, remuser)
SELECT i01.p06 as nr01, 
       i01.p013 as p01, 
       1 as p08, 
       '*#*' as p06, 
       i01.remfdate as remfdate, 
       i01.remftime as remftime, 
       i01.remfuser as remfuser, 
       curdate()    as remdate, 
       curtime()    as remtime, 
       '{user_pswd}' as remuser 
FROM i01
LEFT JOIN a60 ON a60.nr01=i01.p06
where i01.p07=3
   && a60.nr01 is null
GROUP BY i01.p06;   
/*peg_end*/
