我想将table1中的sum(columne)更新为table2中的列 我试着在sql中这样做:
UPDATE stock SET stock.chairout = (SELECT SUM(chairs_count) FROM Event
)
WHERE (([Event].[returned]))=False;
但它给了我错误(它不是更新能查询)
你能帮忙解决这个问题吗?答案 0 :(得分:0)
您的查询是:
UPDATE stock
SET stock.chairout =
(
SELECT SUM(chairs_count)
FROM Event
)
WHERE Event.returned = False
你的where子句不应该在括号内,如下:
UPDATE stock
SET stock.chairout =
(
SELECT SUM(chairs_count)
FROM Event
WHERE Event.returned = False
)