我有两个数据库,n和p。以下是我尝试使用的更新查询。我希望它添加从n到p的日期和项目编号。出于某种原因,在我运行查询后,我最终得到了更多的记录,然后我就开始了。这是怎么回事?
UPDATE DatesAndProjectNumbers
AS n
LEFT JOIN Projects
AS p
ON (n.[Customer Number] = p.[Customer Number])
AND (n.[Measure Received] = p.[Measure Received])
SET p.PO = [n].[PO], p.[PGI/Invoice] = [n].[PGI/Invoice], p.Cancelled = [n].[Cancelled];
答案 0 :(得分:1)
UPDATE DatesAndProjectNumbers
AS n
INNER JOIN Projects
AS p
ON (n.[Customer Number] = p.[Customer Number])
AND (n.[Measure Received] = p.[Measure Received])
SET p.PO = [n].[PO], p.[PGI/Invoice] = [n].[PGI/Invoice], p.Cancelled = [n].[Cancelled];