解决方案: |
UPDATE RdRecords
SET RdRecords.iUnitCost =IA_Subsidiary.iInCost,
RdRecords.iPrice =IA_Subsidiary.iAInPrice
FROM RdRecords
INNER JOIN RdRecord ON RdRecords.ID = RdRecord.ID
INNER JOIN IA_Subsidiary ON RdRecords.AutoID = IA_Subsidiary.ID
WHERE (RdRecords.iUnitCost IS NULL)
AND (RdRecords.iPrice IS NULL)
and (IA_Subsidiary.cVouType in('08','10','01'))
and (RdRecord.cAccounter IS NOT NULL)
UPDATE RdRecords
SET RdRecords.iUnitCost =IA_Subsidiary.iInCost, RdRecords.iPrice =IA_Subsidiary.iAOutPrice
FROM RdRecords
INNER JOIN RdRecord ON RdRecords.ID = RdRecord.ID
INNER JOIN IA_Subsidiary ON RdRecords.AutoID = IA_Subsidiary.ID
WHERE (RdRecords.iUnitCost IS NULL) AND (RdRecords.iPrice IS NULL)
and (IA_Subsidiary.cVouType in('09','11')) and (RdRecord.cAccounter IS NOT NULL) |