Originally posted by skhanal
You may have to change this statement

SELECT MAX(VTA020SAP1.CNRCLI) FROM VTA020SAP1
GROUP BY VTA020SAP1.CNUECOD

to

SELECT MAX(A.CNRCLI) FROM VTA020SAP1 A
where VTA020SAP1.CNUECOD = A.CNUECOD

But again if you have two or more records in VTA020SAP1 with same CNRCLI then you will still get the error.
THX but it insert only one row we have 7000 rows in VTA020SAP1 and 7000 in VTA020