在这里输入图像描述我想更新产品中的付款列时,付款金额得到插入有关产品。。。
create table Product(
PID INT primary key,
Paid int not null default 0 ,
Total int not null
);
create table payment(
paymentid int primary key,
productid int not null,
amount int not null,
foreign key (productid) references product(paid)
);
(I am just using the dummy table to practice update using join)
update product
set product.paid=(pay.amount+pr.Paid)
from-----> here I am getting error
payment pay
inner join product pr on
pay.productid=pr.pid;
1条答案
按热度按时间lxkprmvk1#
我测试它现在工作正常。我希望它对你有用。请告诉我。如果你还面临同样的问题。谢谢。更多细节。https://www.mysqltutorial.org/mysql-update-join/