PHP код:
select contractSpecification
join sum(InvoiceQty)
from purchLine
where contractSpecification.ItemId == purchLine.ItemId &&
contractSpecification.Licence == purchLine.OR_Licence &&
contractSpecification.CIP == purchLine.PurchPrice &&
purchLine.PurchId == purchTable.PurchId; // ---? откуда-то PurchTable взялось?
contractSpecification.QuotaDelivered = purchLine.OR_InvoiceQty;
contractSpecification.update();
С Уважением,
Георгий