Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
update product set qty=100 + (select qty from product p where p.name='abc' and p.weight='100g') where name='abc' and weight='100g'
我想将 100 的新数量添加到产品的现有数量中。这给了我这样的错误,
'您不能在 FROM 子句中指定目标表 'product' 进行更新'
怎么解决????
你只需要这样做:
update product set qty= qty + 100 where name='abc' and weight='100g'