我有一个客户帐户和客户表,客户col
可以将它们链接起来,并获得日期col
到客户表中。
帐户表:
客户表:
决赛桌:
如果我使用以下查询,则表示正在跟踪错误
错误:用作查询的子查询返回的一行以上
我在做什么错了?
UPDATE account
SET date = (
SELECT date
FROM customer
WHERE customer.customer = account.customer
);
答案 0 :(得分:1)
考虑update ... join ... set
语法:
update account a
inner join customer c on a.customer = c.custom
set a.date = c.date