表 :属性
shopcart: id,productid,count...
product: id,salecount...shopcart.productid与product.id对应怎么实现 将shopcart.count加到与之对应的product.salecount上
另:再加个条件shopcart.orderid = onevalue (常量-要处理的订单值)
shopcart: id,productid,count...
product: id,salecount...shopcart.productid与product.id对应怎么实现 将shopcart.count加到与之对应的product.salecount上
另:再加个条件shopcart.orderid = onevalue (常量-要处理的订单值)
set p.salecount = s.count+p.salecount
where exists (
select s.count
from shopcart s
where s.orderid = &onevalue
and p.id = s.productid
);
如果是update:update product p
set p.salecount = s.count
where exists (
select s.count
from shopcart s
where s.orderid = &onevalue
and p.id = s.productid
);
*
ERROR 位于第 1 行:
ORA-00904: "S"."COUNT": 无效的标识符不行 2张表 不知道怎么操作
不过还是这个错误 * 还是在前面那个s.count下面 无法识别ERROR 位于第 1 行:
ORA-00904: "S"."COUNT": 无效的标识符