我有这个查询:
UPDATE client SET client.[client_history] = 10 FROM [T_CLIENT] AS client INNER JOIN (SELECT [client_id], SUM([final_price]) FROM [T_PURCHASE] GROUP BY [client_id]) AS p ON client.[client_id] = p.[client_id]
在访问时执行此查询时,出现“语法错误”。你有看错吗?
谢谢
您可以使用aDSUM来对更新查询中的其他表求和。具有聚合的子查询将无法工作,因为它们不可更新。
DSUM
UPDATE t_client SET [client_history] = DSUM("final_price", "T_PURCHASE", "client_id = " & client_id)