I have an account and customer tables which can be linked by customer col
and get the date col
to the account table.
account table :
customer table :
final table :
If I use the below query, I am getting following error
ERROR: more than one row returned by a subquery used as an expression
What am I doing wrong?
UPDATE account
SET date = (
SELECT date
FROM customer
WHERE customer.customer = account.customer
);
Consider the update... join... set
syntax:
update account a
inner join customer c on a.customer = c.custom
set a.date = c.date
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.