
或者:
update A as a,B as b,C as c set a.ls=c.ls where a.bmid=b.bmid and b.dj=c.dj
update A set A. nature='XXX' from A, B, C where A.id=B.rowid and B.rowid=C.kid and (这里写你的条件, 比如什么哪个表的ID)可以这样更新update Product SET 库存= T1.数量 - T2.数量
from
(select 商品名称,sum(数量) as 数量 from purchase group by 商品名称) as T1,
(select 商品名称,sum(数量) as 数量 from sale group by 商品名称) as T2
where T1.商品名称 = T2.商品名称 and product.商品名称 = T1.商品名称
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)